Skip to content

Instantly share code, notes, and snippets.

@andreyvit
andreyvit / tmux.md
Created June 13, 2012 03:41
tmux cheatsheet

tmux cheat sheet

(C-x means ctrl+x, M-x means alt+x)

Prefix key

The default prefix is C-b. If you (or your muscle memory) prefer C-a, you need to add this to ~/.tmux.conf:

remap prefix to Control + a

@simonholgate
simonholgate / gist:1632764
Created January 18, 2012 12:22
clojure.java.jdbc Oracle clob
(defn clob-to-string [clob]
"Turn an Oracle Clob into a String"
(with-open [rdr (java.io.BufferedReader. (.getCharacterStream clob))]
(apply str (line-seq rdr))))
(with-connection mydb
(transaction
(with-query-results rs ["select documentation from station"]
; rs will be a sequence of maps,
; one for each record in the result set.
@aviflax
aviflax / restlet_request_timeout.groovy
Created September 7, 2011 23:13
How to reliably implement a request timeout for Restlet's Client and ClientResource classes
#!/usr/bin/env groovy
@GrabResolver(name="restlet", root="http://maven.restlet.org/")
@Grab(group="org.restlet.jse", module="org.restlet", version="2.0.9")
// request timeouts reliably only with Apache HttpClient
@Grab(group="org.restlet.jse", module="org.restlet.ext.httpclient", version="2.0.9")
import org.restlet.*
import org.restlet.data.*
@coldnebo
coldnebo / Default (Linux).sublime-keymap
Created August 10, 2011 23:20
simple scripts to prettify your xml and json in sublime text 2
[
{ "keys": ["ctrl+shift+x"], "command": "tidy_xml" },
{ "keys": ["ctrl+shift+j"], "command": "prettify_json" }
]
@ghoseb
ghoseb / ns-cheatsheet.clj
Last active November 2, 2025 23:29 — forked from alandipert/ns-cheatsheet.clj
Clojure ns syntax cheat-sheet
;;
;; NS CHEATSHEET
;;
;; * :require makes functions available with a namespace prefix
;; and optionally can refer functions to the current ns.
;;
;; * :import refers Java classes to the current namespace.
;;
;; * :refer-clojure affects availability of built-in (clojure.core)
;; functions.