Skip to content

Instantly share code, notes, and snippets.

@henrik
henrik / hash_deep_diff.rb
Created July 14, 2009 08:38
Recursively diff two Ruby hashes.
# Recursively diff two hashes, showing only the differing values.
# By Henrik Nyh <http://henrik.nyh.se> 2009-07-14 under the MIT license.
#
# Example:
#
# a = {
# "same" => "same",
# "diff" => "a",
# "only a" => "a",
# "nest" => {
@rkh
rkh / Scala
Created April 2, 2010 19:08
examples for sinatra like frameworks
package com.thinkminimo.step
class StepExample extends Step {
get("/") { "Hello World!" }
}
@dnagir
dnagir / rspec-syntax-cheat-sheet.rb
Created November 5, 2010 09:29
RSpec 2 syntax cheat sheet by example
# RSpec 2.0 syntax Cheet Sheet by http://ApproachE.com
# defining spec within a module will automatically pick Player::MovieList as a 'subject' (see below)
module Player
describe MovieList, "with optional description" do
it "is pending example, so that you can write ones quickly"
it "is already working example that we want to suspend from failing temporarily" do
pending("working on another feature that temporarily breaks this one")
@pete
pete / 0-README
Last active February 10, 2024 07:12
Various implementations of the 'cat' command, for comparison.
I turned this gist into a "real" repository. It is here: http://github.com/pete/cats .
Here, placed side-by-side for comparison, are GNU's implementation of
cat, Plan 9's implementation, Busybox's implementation, and NetBSD's
implementation, Seventh Edition Unix (1979), and 4.3BSD.
For good measure (and because I suppose I am now committed to collecting
cats) also included are Second Edition Unix (in assembly) and Inferno's
implementation (in Limbo) for good measure.

Sass/Less Comparison

In this document I am using Sass's SCSS syntax. You can choose to use the indented syntax in sass, if you prefer it, it has no functional differences from the SCSS syntax.

For Less, I'm using the JavaScript version because this is what they suggest on the website. The ruby version may be different.

Variables

@jordansissel
jordansissel / README.md
Created June 19, 2011 07:26
fpm target 'puppet' - nodejs as example

fpm --target puppet

At time of writing, this isn't feature complete (it doesn't yet generate anticlasses for package uninstalls, for example). But it'll install stuff :)

./configure --prefix=/opt/nodejs/0.4.8
make
make install DESTDIR=/tmp/workdir

Now use fpm to build a puppet module to install nodejs:

@onyxfish
onyxfish / wordpress.vcl
Created June 28, 2011 21:34
ChicagoNow Varnish configuration (development version)
backend app1 {
.host = "127.0.0.1";
.port = "8000";
}
acl purge {
"127.0.0.1";
"::1";
}
. .
. . IMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM
.IMMMMMMMMMMMMMM8I . ... . =MMMM
:MMMMMMMMMZ . 7MMMMZ . 7MD . IMMD .
MMMMM. . . . .~ .M, . MMM .
MMMM, N. .IDMMMO777ZNMMMMMO =MM . M:. NMM.
. ZMMM . . :7NMMDI= . MM IM MMM
MMM IMM77IDMMM, . M8 ..MM M ,N MMM
M8 M M . M ,O . 7. MM
.M8 D ,.
require 'socket'
profile = false
if ARGV.first == "-p"
profile = true
ARGV.shift
end
port = ARGV.shift
@rtomayko
rtomayko / gist:1202895
Created September 8, 2011 08:11
The Sazerac
You'll need:
- Old Fashioned glasses, two of
- Sugar cubes, two of
- Peychaud's Aromatic Cocktail Bitters, one bottle of
- Ice, enough to fill both glasses
- Water, one oz of
- Rye whisky, two oz of
- St. George Absinthe Verte, 0.333oz of
- Lemon, one twist of