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
def assert( bool, msg ) | |
puts (bool ? "Pass " : "Fail ") + msg | |
end | |
class Hash | |
def destruct( &block ) | |
vals = block.parameters.map { |p| self[p[1]] } | |
block.call(*vals) | |
end | |
end |
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
- content_for(:inner_content) do | |
= render :partial => "inner_content" | |
- if some_condition | |
%outertag1= yield :inner_content | |
- else | |
%outertag2= yield :inner_content |
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
require "rubygems" | |
require "chunky_png" | |
require "base64" | |
module Sass::Script::Functions | |
def background_noise(c, noise = 0.5, opacity = 0.08, size = 200, mono = false) | |
# Convert SASS numbers to Ruby classes | |
noise = noise.to_s.to_f if noise.is_a? Sass::Script::Number |
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
#!/usr/bin/env python | |
""" | |
Just put this line in your ~/.shell-fm/shell-fm.rc | |
np-cmd = /path/to/shellfm-notify "%a" "%t" "%l" | |
""" | |
import os | |
import sys | |
import Image |
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
#!/usr/bin/env zsh | |
if [[ -s "${TM_PROJECT_DIRECTORY}/.rvmrc" ]] | |
then | |
source "${TM_PROJECT_DIRECTORY}/.rvmrc" | |
fi | |
exec ruby "$@" |
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
For each Ruby module/class, we have Ruby methods on the left and the equivalent | |
Clojure functions and/or relevant notes are on the right. | |
For clojure functions, symbols indicate existing method definitions, in the | |
clojure namespace if none is explicitly given. clojure.contrib.*/* functions can | |
be obtained from http://github.com/kevinoneill/clojure-contrib/tree/master, | |
ruby-to-clojure.*/* functions can be obtained from the source files in this | |
gist. | |
If no method symbol is given, we use the following notation: |