Skip to content

Instantly share code, notes, and snippets.

View shelling's full-sized avatar

shelling shelling

View GitHub Profile
# Use Jruby to read hadoop sequence files
def load_libs(libs)
Dir.glob(File.join(libs,"*.jar")).each { |f|
require f
}
end
load_libs ENV["HADOOP_HOME"]
load_libs File.join(ENV["HADOOP_HOME"], 'lib')
@fnhipster
fnhipster / html5.haml
Created April 9, 2011 01:19
HTML5 HAML Template
!!! 5
%html
%head
%title= "Your Website"
%meta{ :content => "", :name => "description" }
%meta{ :content => "", :name => "author" }
%meta{ :content => "3 days", :name => "revisit-after" }
%link{ :href => "http://creativecommons.org/licenses/by/3.0/", :rel => "license", :title => "Creative Commons Attribution 3.0 Unported License" }
%link{ :href => "/feed", :rel => "alternate", :title => "Atom", :type => "application/atom+xml" }
%link{ :href => "/css/screen.css", :media => "screen", :rel => "stylesheet" }
@shelling
shelling / load.sh
Created April 9, 2011 06:14
recursive rcfile loader
# vim: syntax=sh
#
function load {
if [ -f $1 ]; then
source $1
fi
if [ -d $1 ]; then
for file in $1/*; do
load $file
@shelling
shelling / foreach.el
Created April 12, 2011 05:48
foreach in elisp
#!/usr/bin/env emacs --script
(require 'cl)
(defun foreach (alist func)
(while alist
(progn
(funcall func (car alist))
(setq alist (cdr alist)))
))
@mirisuzanne
mirisuzanne / reference.mkdn
Created August 22, 2011 23:34
Susy 0.9 Reference Documentation

Susy 0.9 Reference Documentation

See the official Susy site for 1.0 documentation.

Terms

  • Susy Grid: A grid that you build with Susy. You can have multiple on one page if you need.
  • Grid Element: Any HTML element that is aligned to a Susy Grid.
  • Container: The root element in a Susy Grid. Anything inside it is a potential Grid Element.
@liuwen-lvtu
liuwen-lvtu / tutorial.mkdn
Created October 18, 2011 03:19 — forked from mirisuzanne/tutorial.mkdn
A new Susy tutorial

Susy Tutorial

For this tutorial I'm assuming you are already comfortable with CSS, Sass (I'll use the SCSS syntax) and Compass. Please get set up with each one of those before attempting to use Susy. Sass and Compass both have their own setup instructions and tutorials that you can use.

There is also reference documentation in the works.

What Susy Does

CSS Systems

@tokland
tokland / ar_arel_wrapper.rb
Last active March 5, 2024 06:22
Simple wrapper over arel
require 'active_record'
require 'arel'
# Ruby-like syntax in AR conditions using the underlying Arel layer (Rails >= 3.0).
#
# What you would usually write like this:
#
# User.where(["users.created_at > ? AND users.name LIKE ?", Date.yesterday, "Mary"])
#
# can now be written like this (note those parentheses required by the operators precedences):
@hamajyotan
hamajyotan / extconf.rb
Created December 6, 2011 10:56
Data_Wrap_Struct example
require "mkmf"
$libs += " -lstdc++ "
create_makefile("human")
@erikh
erikh / hack.sh
Created March 31, 2012 07:02 — forked from DAddYE/hack.sh
OSX For Hackers
#!/usr/bin/env sh
##
# This is script with usefull tips taken from:
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
#
# install it:
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh
#
@jlong
jlong / uri.js
Created April 20, 2012 13:29
URI Parsing with Javascript
var parser = document.createElement('a');
parser.href = "http://example.com:3000/pathname/?search=test#hash";
parser.protocol; // => "http:"
parser.hostname; // => "example.com"
parser.port; // => "3000"
parser.pathname; // => "/pathname/"
parser.search; // => "?search=test"
parser.hash; // => "#hash"
parser.host; // => "example.com:3000"