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
napple:caketest zkim$ ~/clojurelibs/cake/bin/cake deps | |
warning: error loading file used by /Users/zkim/caketest/tasks.clj: java.io.FileNotFoundException: Could not locate clj_ssh/core__init.class or clj_ssh/core.clj on classpath: (tasks.clj:1) | |
if you've added a library to :dev-dependencies you must run 'cake deps' to install it | |
[pom] creating pom.xml | |
[deps] Fetching dependencies... | |
[deps] Copying 4 files to /Users/zkim/caketest/build/lib | |
[deps] Copying 3 files to /Users/zkim/caketest/build/lib/dev | |
[deps] Deleting directory /Users/zkim/caketest/lib | |
[deps] Attempting to rename dir: /Users/zkim/caketest/build/lib to /Users/zkim/caketest/lib | |
[clean] Deleting /Users/zkim/caketest/.cake/run/clean |
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 do-deploy-key [req] | |
(record-public-key req "zkim") | |
(let [key (lookup-for-target :zkim :id_rsa.pub)] | |
(deploy-key req | |
"project" | |
"key-title" | |
key | |
:username "<github user>" | |
:apikey "<github-api>"))) |
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
(defmacro check-let [b-vec & body] | |
(if-not (empty? b-vec) | |
(let [v (take 3 b-vec) | |
r (apply vector (drop 3 b-vec))] | |
`(if-let [~@(take 2 v)] | |
(check-let ~r ~@body) | |
~(nth v 2))) | |
`(do ~@body))) | |
;; turns this: |
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
;; http://www.engineyard.com/blog/2010/engine-yard-lucky-13-contest/ | |
;; 1. `wget https://github.com/technomancy/leiningen/raw/stable/bin/lein --no-check-certificate` | |
;; 2. `chmod u+x ./lein` | |
;; 3. `./lein repl` | |
;; 4. copy & paste into repl | |
(use 'clojure.contrib.json) | |
(defn spin! [] |
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
;; Hack Clojure's LispReader to keep comments. Munges LispReader pretty badly, so maybe | |
;; pair with ninjudd's classloading lib (classlojure I think)? | |
(use 'clojure.contrib.reflect) | |
(defn read-comment [reader semicolon] | |
(let [sb (StringBuilder.)] | |
(.append sb semicolon) | |
(loop [ch (char (.read reader))] | |
(if (or (= ch \newline) |
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
function Set(t) | |
local s = {} | |
for _,v in pairs(t) do s[v] = true end | |
return s | |
end | |
function set_contains(t, e) | |
return t[e] | |
end |
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
# command prefix (like screen) | |
set -g prefix C-z | |
bind C-z last-window | |
unbind C-b | |
# Set status bar | |
set -g status-bg black | |
set -g status-fg white | |
set -g status-left '#[fg=green]#H' |
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
(-> {:headers nil} | |
:headers | |
#(get % "Content-Type")) | |
;; => clojure.lang.Symbol cannot be cast to clojure.lang.IPersistentVector ?! | |
;; I thought I saw this working at one point. | |
(-> {:headers nil} | |
:headers |
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
# (org.apache.http.conn.HttpHostConnectException) "Connection to https://github.com:443 refused" | |
org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection(DefaultClientConnectionOperator.java:158) | |
org.apache.http.impl.conn.AbstractPoolEntry.open(AbstractPoolEntry.java:149) | |
org.apache.http.impl.conn.AbstractPooledConnAdapter.open(AbstractPooledConnAdapter.java:121) | |
org.apache.http.impl.client.DefaultRequestDirector.tryConnect(DefaultRequestDirector.java:562) | |
org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:415) | |
org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:820) | |
org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:754) | |
org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:732) |
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-add-repository "deb http://archive.canonical.com/ natty partner" | |
sudo apt-get update | |
sudo apt-get install sun-java6-jdk |