Skip to content

Instantly share code, notes, and snippets.

View jiyouyou125's full-sized avatar

zhangzhihong jiyouyou125

  • beijing,china
View GitHub Profile
@jiyouyou125
jiyouyou125 / 00_script.clj
Created January 28, 2022 08:54 — forked from ericnormand/00_script.clj
Boilerplate for running Clojure as a shebang script
#!/bin/sh
#_(
#_DEPS is same format as deps.edn. Multiline is okay.
DEPS='
{:deps {clj-time {:mvn/version "0.14.2"}}}
'
#_You can put other options here
OPTS='
@jiyouyou125
jiyouyou125 / lein2-issue.md
Created March 30, 2017 08:53 — forked from stuartsierra/lein2-issue.md
'file:' repositories in Leiningen 2.0.0-preview5 and later

Sample Project

Starting from:

lein new foo
cd foo

Say I have a random JAR file that is not available in any repository:

touch README.md

(ns example.nrepl
(:require [clojure.tools.nrepl.server :refer [start-server stop-server]]
[cider.nrepl :refer [cider-nrepl-handler]])
(:gen-class))
(defn -main [port]
(let [port (Integer. port)]
(defonce server (start-server :port port :handler cider-nrepl-handler))))
@jiyouyou125
jiyouyou125 / sci_classifier.py
Created June 30, 2016 06:11 — forked from 2shou/sci_classifier.py
scikit-learn nb example
# coding: utf-8
import sys
import jieba
import numpy
from sklearn import metrics
from sklearn.feature_extraction.text import HashingVectorizer
from sklearn.naive_bayes import MultinomialNB
@jiyouyou125
jiyouyou125 / aggregateop.png
Created February 17, 2016 11:09 — forked from ilya-pimenov/aggregateop.png
Full article here — http://ilyapimenov.com/blog/2013/11/14/hyperloglog-with-cascalog.html. We’ll look shortly in how you would utilize awesomeness of both Cascalog and HyperLogLog in order to execute Hadoop M/R tasks with amounts of data too big to have them in their original form.
aggregateop.png
@jiyouyou125
jiyouyou125 / jdbc_tap.clj
Created January 17, 2016 05:13 — forked from MrJaba/jdbc_tap.clj
Cascalog JDBCTap Example
(defn query-params []
(into-array String ["?col1" "?col2"]))
(defn column-names []
(into-array String ["col1" "col2"]))
; Becomes the 'where' part of the UPDATE statement - use primary key for example
(defn update-params []
(into-array String ["?col1"]))
(ns app.loader
(:require [pigpen.raw :as raw]
[pigpen.core :as pig]
;[pigpen.parquet.local :as parquet]
;[pigpen.util :refer [pigsym-zero pigsym-inc]]
)
(:import (parquet.hadoop.ParquetReader)
(parquet.tools.read SimpleReadSupport SimpleRecord SimpleRecord$NameValue)
(parquet.hadoop ParquetReader)
(org.apache.hadoop.fs Path)))
5bebb03ee96e5b24ab15cef458679de7.apk,
02379bef9bc95118cc43fff7cf0aac4a.apk,
4a0cb26031a14241eb9cfd385e9fffab.apk,
f4ebf3a885f3b969c1d76fa3a9191184.apk,
361906952373a926f1fbd8e3ce3b003e.apk,chartboost,BANNER_AD ,,N
3f6d8de2b84ee82acaff1bcae4d160db.apk,
2bbd877c13d40763c835aae1ae098045.apk,
124ba77bbfec97d58803e1d80fecad22.apk,
73d34975480140223e556e259a9acb53.apk,
8ee36e658e51dcd1d18ba526189db120.apk,
use strict;
use warnings;
use LWP::UserAgent;
use Data::Dumper;
my $ua = LWP::UserAgent->new();
$ua->agent('Mozilla/5.0 (Windows NT 6.1; WOW64; rv:28.0) Gecko/20100101 Firefox/28.0');
$ua->get("http://live2.bet007.com");
$ua->default_header('Content-Type' => 'application/x-javascript');
$ua->default_header('Referer' => 'http://live2.bet007.com/');
@jiyouyou125
jiyouyou125 / gist:5371187
Created April 12, 2013 10:43
movable type 5.2.3
use strict;
use lib $ENV{MT_HOME} ? "$ENV{MT_HOME}/lib" : 'lib';
use lib $ENV{MT_HOME} ? "$ENV{MT_HOME}/extlib" : 'extlib';
use MT::PSGI;
use Plack::Builder;
builder {
enable 'Static',
path => qr{^/(?:(?!mt/|mt-static/))},
root => '/var/www/html';