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
| import socket | |
| import subprocess | |
| current = "/var/www/star-track/star-tracker.jar" | |
| latest = "/opt/star-track/release/star-tracker.jar" | |
| def get_md5(f): | |
| proc = subprocess.Popen(["md5sum", f],stdout=subprocess.PIPE) | |
| result_str = "" | |
| md5 = "" |
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
| ; The Lisp defined in McCarthy's 1960 paper, translated into CL. | |
| ; Assumes only quote, atom, eq, cons, car, cdr, cond. | |
| ; Bug reports to lispcode@paulgraham.com. | |
| (defun null. (x) | |
| (eq x '())) | |
| (defun and. (x y) | |
| (cond (x (cond (y 't) ('t '()))) | |
| ('t '()))) |
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
| log_format info '$connection $msec $status $request_time $remote_addr $host ' | |
| '"$request" $body_bytes_sent "$http_referer" ' | |
| '"$http_user_agent" "$http_x_forwarded_for"'; |
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
| """ | |
| ========================================================= | |
| Comparing different clustering algorithms on toy datasets | |
| ========================================================= | |
| This example aims at showing characteristics of different | |
| clustering algorithms on datasets that are "interesting" | |
| but still in 2D. The last dataset is an example of a 'null' | |
| situation for clustering: the data is homogeneous, and | |
| there is no good clustering. |
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
| ;; all the following destructuring forms can be used in any of the | |
| ;; Clojure's `let` derived bindings such as function's parameters, | |
| ;; `let`, `loop`, `binding`, `for`, `doseq`, etc. | |
| ;; list, vectors and sequences | |
| [zero _ _ three & four-and-more :as numbers] (range) | |
| ;; zero = 0, three = 3, four-and-more = (4 5 6 7 ...), | |
| ;; numbers = (0 1 2 3 4 5 6 7 ...) | |
| ;; maps and sets |
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
| (ns fetcher.core | |
| (:use [clojure.java.io :as io]) | |
| (:use [net.cgrand.enlive-html])) | |
| (defn fetch-all-images-from-url [src-url dest-folder] | |
| (let [ | |
| ; get root from src-url: http://google.com/alias1/2/3 ---> http://google.com | |
| root-url (clojure.string/join "/" (take 3 (clojure.string/split src-url #"/"))) | |
| ; function: if image url starts with "/" ( / character is: \/ in Clojure, ex \a \b etc...) append root url |
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
| """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" | |
| " Maintainer: | |
| " Amir Salihefendic | |
| " http://amix.dk - amix@amix.dk | |
| " | |
| " Version: | |
| " 5.0 - 29/05/12 15:43:36 | |
| " | |
| " Blog_post: | |
| " http://amix.dk/blog/post/19691#The-ultimate-Vim-configuration-on-Github |
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
| set -x LEIN_SNAPSHOTS_IN_RELEASE y | |
| set -x DOCKER_HOST tcp://192.168.59.103:2376 | |
| set -x DOCKER_CERT_PATH /Users/bahadir/.boot2docker/certs/boot2docker-vm | |
| set -x DOCKER_TLS_VERIFY 1 | |
| set -x LC_ALL en_US.UTF-8 | |
| set -x LANG en_US.UTF-8 | |
| alias tigs "tig status" | |
| alias gitpatch "git add * -p" | |
| alias gitpm "git push origin master" |
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
| sudo apt-get install openjdk-7-jdk | |
| java -version | |
| # java version "1.7.0_25" | |
| # OpenJDK Runtime Environment (IcedTea 2.3.12) (7u25-2.3.12-4ubuntu3) | |
| # OpenJDK 64-Bit Server VM (build 23.7-b01, mixed mode) | |
| cd /usr/lib/jvm | |
| ln -s java-7-openjdk-amd64 jdk | |
| sudo apt-get install openssh-server |
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
| (ns rbl.feature-extraction.user-agent | |
| (:use [clojure.core.memoize :only [memo]]) | |
| (:require [clojure.tools.logging :as log]) | |
| (:import [nl.bitwalker.useragentutils UserAgent DeviceType Browser OperatingSystem])) | |
| (defn str->features [string] | |
| (try | |
| (let [user-agent (UserAgent. (or string ""))] | |
| {:browser_group (-> user-agent .getBrowser .getGroup .getName) | |
| :os_group (-> user-agent .getOperatingSystem .getGroup .getName) |