Simply put, destructuring in Clojure is a way extract values from a datastructure and bind them to symbols, without having to explicitly traverse the datstructure. It allows for elegant and concise Clojure code.
This file contains 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
#!/bin/bash | |
usage() { | |
cat << EOF | |
Usage: $0 [OPTION]... COMMAND | |
Execute the given command in a way that works safely with cron. This should | |
typically be used inside of a cron job definition like so: | |
* * * * * $(which "$0") [OPTION]... COMMAND | |
Arguments: |
This file contains 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
git bisect start HEAD HEAD~20 && git bisect run rspec ./spec/YOUR_TEST_FILE.rb:LINE_NUMBER ; git bisect reset |
This file contains 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 org.flausenhaus.rocksdb | |
"Idiomatic Clojure bindings for the C++ RocksDB library, an embedded | |
persistent key-value store for flash storage and server workloads based on | |
LevelDB. More details about RocksDB are given at | |
https://github.com/facebook/rocksdb/wiki/Rocksdb-Architecture-Guide. | |
The implementation here borrows heavily from Factual's clj-leveldb. | |
This namespace provides a few things: | |
0. Protocols/type definitions: byte serialization (IByteSerializable), | |
closeable sequences (CloseableSeq), and mutable |
This file contains 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
let s:prompt = hostname()."#" | |
let s:history = '' | |
let s:push_dir = '' | |
function! s:ShowPrompt() | |
exec "normal I".s:prompt." " | |
normal $ | |
endfunction | |
function! s:DoLeft() |
Hi there!
The docker cheat sheet has moved to a Github project under https://github.com/wsargent/docker-cheat-sheet.
Please click on the link above to go to the cheat sheet.
This file contains 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
preload_app! | |
min_threads = Integer(ENV['MIN_THREADS'] || 0) | |
max_threads = Integer(ENV['MAX_THREADS'] || 5) | |
threads min_threads, max_threads | |
workers Integer(ENV['WORKER_COUNT'] || 3 ) | |
on_worker_boot do | |
ActiveSupport.on_load(:active_record) do |
This file contains 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
#!/bin/bash | |
################################################################################## | |
# 1 - Create the base container | |
SUITE=squeeze | |
RELEASE=$SUITE | |
sudo lxc-create -n ${RELEASE}-base -t debian | |
rootfs="/var/lib/lxc/${RELEASE}-base/rootfs" |
This file contains 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
package main | |
import ( | |
"bufio" | |
"encoding/json" | |
"log" | |
"net/http" | |
) | |
func main() { |
This file contains 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
export PATH ; PATH="/usr/local/rvm/gems/ruby-1.9.3-p429/bin:/usr/local/rvm/gems/ruby-1.9.3-p429@global/bin:/usr/local/rvm/rubies/ruby-1.9.3-p429/bin:/usr/local/rvm/bin:$PATH" | |
export rvm_env_string ; rvm_env_string='ruby-1.9.3-p429' | |
export rvm_path ; rvm_path='/usr/local/rvm' | |
export rvm_ruby_string ; rvm_ruby_string='ruby-1.9.3-p429' | |
unset rvm_gemset_name | |
export RUBY_VERSION ; RUBY_VERSION='ruby-1.9.3-p429' | |
export GEM_HOME ; GEM_HOME='/usr/local/rvm/gems/ruby-1.9.3-p429' | |
export GEM_PATH ; GEM_PATH='/usr/local/rvm/gems/ruby-1.9.3-p429:/usr/local/rvm/gems/ruby-1.9.3-p429@global' | |
export MY_RUBY_HOME ; MY_RUBY_HOME='/usr/local/rvm/rubies/ruby-1.9.3-p429' | |
export IRBRC ; IRBRC='/usr/local/rvm/rubies/ruby-1.9.3-p429/.irbrc' |