(C-x means ctrl+x, M-x means alt+x)
The default prefix is C-b. If you (or your muscle memory) prefer C-a, you need to add this to ~/.tmux.conf
:
(defn jsArr | |
"Recursively converts a sequential object into a JavaScript array" | |
[seq] | |
(.array (vec (map #(if (sequential? %) (jsArr %) %) | |
seq)))) | |
(defn jsObj | |
"Convert a clojure map into a JavaScript object" | |
[obj] | |
(.strobj (into {} (map (fn [[k v]] |
#!/usr/bin/env bash | |
# Use this one-liner to produce a JSON literal from the Git log: | |
git log \ | |
--pretty=format:'{%n "commit": "%H",%n "author": "%aN <%aE>",%n "date": "%ad",%n "message": "%f"%n},' \ | |
$@ | \ | |
perl -pe 'BEGIN{print "["}; END{print "]\n"}' | \ | |
perl -pe 's/},]/}]/' |
<!-- Add the following lines to theme's html code right before </head> --> | |
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.0/jquery.min.js"></script> | |
<script src="http://static.tumblr.com/fpifyru/VCxlv9xwi/writecapture.js"></script> | |
<script src="http://static.tumblr.com/fpifyru/AKFlv9zdu/embedgist.js"></script> | |
<!-- | |
Usage: just add <div class="gist">[gist URL]</div> | |
Example: <div class="gist">https://gist.github.com/1395926</div> | |
--> |
(ns stats) | |
(defn mode [vs] | |
(let [fs (frequencies vs)] | |
(first (last (sort-by second fs))))) | |
(defn quantile | |
([p vs] | |
(let [svs (sort vs)] | |
(quantile p (count vs) svs (first svs) (last svs)))) |
----- Esc ----- | |
Quick change directory: Esc + c | |
Quick change directory history: Esc + c and then Esc + h | |
Quick change directory previous entry: Esc + c and then Esc + p | |
Command line history: Esc + h | |
Command line previous command: Esc + p | |
View change: Esc + t (each time you do this shortcut a new directory view will appear) | |
Print current working directory in command line: Esc + a | |
Switch between background command line and MC: Ctrl + o | |
Search/Go to directory in active panel: Esc + s / Ctrl + s then start typing directory name |
Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000
IAMUSERID %{NUMBER:iam_user_id} | |
IAMUSERNAME [a-zA-Z0-9._-]+ | |
IAMUSER arn:aws:iam::%{IAMUSERID}:user/%{IAMUSERNAME:iam_user_name} | |
S3TYPE (?:OBJECT) | |
S3OP [a-zA-z]+ | |
S3SOAPOPERATION (?:SOAP\.%{S3OP}) | |
S3RESTOPERATION (?:REST\.%{S3OP}\.%{S3TYPE}) | |
S3WEBSITEOPERATION (?:WEBSITE\.%{S3OP}\.%{S3TYPE}) | |
S3OPERATION (?:%{S3SOAPOPERATION}|%{S3RESTOPERATION}|%{S3WEBSITEOPERATION}) |
IAMUSERID %{NUMBER:iam_user_id} | |
IAMUSERNAME [a-zA-Z0-9._-]+ | |
IAMUSER arn:aws:iam::%{IAMUSERID}:user/%{IAMUSERNAME:iam_user_name} | |
S3TYPE [a-zA-z_]+ | |
S3OP [a-zA-z]+ | |
S3SOAPOPERATION (?:SOAP\.%{S3OP}) | |
S3RESTOPERATION (?:REST\.%{S3OP}(\.%{S3TYPE})?) | |
S3WEBSITEOPERATION (?:WEBSITE\.%{S3OP}\.%{S3TYPE}) | |
S3OPERATION (?:%{S3SOAPOPERATION}|%{S3RESTOPERATION}|%{S3WEBSITEOPERATION}) |
; note: this iteration doesn't work properly. | |
; looks like i don't understand exactly how react.js works for settings dom element properties | |
(set! exports {}) | |
; react macros... | |
(defmacro hash-map-pairs | |
"make a hash map from its arguments. each argument is a tuple (key value)" |