Skip to content

Instantly share code, notes, and snippets.

View jeremyheiler's full-sized avatar

Jeremy Heiler jeremyheiler

View GitHub Profile
@plindberg
plindberg / gist:990919
Created May 25, 2011 12:58
Installing Ruby 1.9.2 via RVM, RubyGems, and Passenger on Debian 5.x (for Rails 3.1 deployment)

Install needed packages

apt-get update
apt-get install build-essential bison openssl libreadline5 libreadline5-dev \
  curl git-core zlib1g zlib1g-dev libssl-dev libyaml-dev libsqlite3-0 \
  libsqlite3-dev sqlite3 libxml2-dev libxslt-dev autoconf libc6-dev ncurses-dev

Install RVM

bash < <(curl -s https://rvm.beginrescueend.com/install/rvm)

@nathanmarz
nathanmarz / gist:1228302
Created September 20, 2011 04:01
Example of defining a topology in Clojure
(use 'backtype.storm.clojure)
(use 'backtype.storm.config)
(require '[backtype.storm [thrift :as thrift]])
(import 'storm.starter.spout.RandomSentenceSpout)
(import 'backtype.storm.LocalCluster)
(defboltfull suffix-bolt ["word"]
:params [suffix]
:let [conf-state (atom nil)]
:prepare ([conf context collector]
@codeforkjeff
codeforkjeff / solarize.sh
Created November 27, 2011 06:43
shell script for setting gnome-terminal color palette to use Solarized theme
#!/bin/sh
#
# Shell script that configures gnome-terminal to use solarized theme
# colors. Written for Ubuntu 11.10, untested on anything else.
#
# Solarized theme: http://ethanschoonover.com/solarized
#
# Adapted from these sources:
# https://gist.github.com/1280177
# http://xorcode.com/guides/solarized-vim-eclipse-ubuntu/
(defn map-keys [f m & [ks]]
(loop [new-map (transient {}) ks ks]
(if (empty? ks)
(persistent! new-map)
(let [[k & ks] ks]
(recur (assoc! new-map k (f (m k))) ks)))))
@drj42
drj42 / org-mode-reference-in.org
Created February 6, 2012 23:53
This is a cheat sheet for Emacs org-mode... in org-mode format!
@unclebob
unclebob / commatize
Created February 7, 2012 17:44
A function to format a number with commas
(defn commatize [n]
(if (nil? n)
""
(let [s (str n)]
(apply str
(reverse (drop-last
(interleave
(reverse s)
(take (count s) (flatten (repeat [nil nil \,]))))))))))

tmux cheatsheet

As configured in my dotfiles.

start new:

tmux

start new with session name:

@MohamedAlaa
MohamedAlaa / tmux-cheatsheet.markdown
Last active July 23, 2024 19:59
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@brandonb927
brandonb927 / osx-for-hackers.sh
Last active July 20, 2024 05:10
OSX for Hackers: Yosemite/El Capitan Edition. This script tries not to be *too* opinionated and any major changes to your system require a prompt. You've been warned.
#!/bin/sh
###
# SOME COMMANDS WILL NOT WORK ON macOS (Sierra or newer)
# For Sierra or newer, see https://github.com/mathiasbynens/dotfiles/blob/master/.macos
###
# Alot of these configs have been taken from the various places
# on the web, most from here
# https://github.com/mathiasbynens/dotfiles/blob/5b3c8418ed42d93af2e647dc9d122f25cc034871/.osx
@AlexBaranosky
AlexBaranosky / gist:4134522
Created November 23, 2012 08:27
doseq-indexed
;; Example:
;; (doseq-indexed idx [name names]
;; (println (str idx ". " name)
(defmacro doseq-indexed [index-sym [item-sym coll] & body]
`(let [idx-atom# (atom 0)]
(doseq [~item-sym ~coll]
(let [~index-sym (deref idx-atom#)]