This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(def song-url "http://www.mzhiphop.com/song-17803-Usher---Paradise") | |
(def song-static "http://www.sharebeast.com/mp3embed-") | |
(defn get-download-url [url] | |
(str song-static | |
(second | |
(str/split (second | |
(str/split | |
(get-in (nth | |
(html/select | |
(html/html-resource |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defun nrepl-refresh () | |
(interactive) | |
(call-interactively 'cider-switch-to-relevant-repl-buffer) | |
(goto-char (point-max)) | |
(insert "(clojure.tools.namespace.repl/refresh)") | |
(cider-repl-return)) | |
(defun nrepl-reset () | |
(interactive) | |
(call-interactively 'cider-switch-to-relevant-repl-buffer) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
echo "Stopping firewall and allowing everyone..." | |
iptables -F | |
iptables -X | |
iptables -t nat -F | |
iptables -t nat -X | |
iptables -t mangle -F | |
iptables -t mangle -X | |
iptables -P INPUT ACCEPT | |
iptables -P FORWARD ACCEPT |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//libexec/bin/bootstrap.js | |
system = require('system'); | |
var argsdeprecated = system.args; | |
argsdeprecated.shift(); | |
phantom.args = argsdeprecated; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defun yui-compress () | |
(interactive) | |
(call-process-region | |
(point-min) (point-max) "yuicompressor" t t nil (buffer-file-name))) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;;iptables,this does not work for docker . You have to set ip explicitly | |
sudo iptables -A INPUT -p tcp -s localhost --dport 9200 -j ACCEPT | |
sudo iptables -A INPUT -p tcp --dport 9200 -j DROP | |
;; starting elasticsearch in a secure fashion | |
sudo docker run --name elastic -d -p 127.0.0.1:9200:9200 -p 127.0.0.1:9300:9300 -v /elastic:/data dockerfile/elasticsearch /elasticsearch/bin/elasticsearch -Des.config=/data/elasticsearch.yml |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
server{ | |
listen 80; | |
proxy_connect_timeout 600; | |
proxy_send_timeout 600; | |
proxy_read_timeout 600; | |
send_timeout 600; | |
server_name asdf; | |
location /{ | |
proxy_set_header X-Real-IP $remote_addr; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defn download-file [url dir] | |
(let [my-file (last (.split url "/"))] | |
(if-not (.exists (io/as-file (str dir my-file))) | |
(try | |
(with-open [ in (io/input-stream url) | |
out (io/output-stream (str dir my-file))] | |
(io/copy in out) | |
(println my-file " has been downloaded.") | |
) | |
(catch Exception e (str "caught exception:" (.getMessage e)))) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
playWithAFriend=和朋友下棋 | |
دوستۇم بىلەن شاھمات ئوينايمەن | |
playWithTheMachine=和机器下棋 | |
ماشىنا شاھمات ئوينايمەن | |
toInviteSomeoneToPlayGiveThisUrl=要邀请别人下棋,请给他这个网址 | |
باشقىلارنى تەكلڭىپ قىلىمەن , تور ئادرېسىنى يوللا | |
gameOver=游戏结束 | |
ئويۇن ئاخىرلاشتى | |
waitingForOpponent=等待对手 | |
رەقىبنى ساقلاش |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; scraping google scholar | |
(def ^:dynamic scholar-base "http://scholar.google.com/scholar?q=") | |
(def start-url "http://scholar.google.com/scholar?q=machine++learning") | |
(def typical-url "http://scholar.google.com/scholar?q=machine++learning&start=10") | |
(defn rebuild-keywords [keyword] | |
(.replace (.trim keyword) " " "+")) |