Skip to content

Instantly share code, notes, and snippets.

View stan's full-sized avatar
💭
¯\_(ツ)_/¯

stan

💭
¯\_(ツ)_/¯
View GitHub Profile
@skorks
skorks / integertoenglish.rb
Created November 3, 2010 11:53
converting integers to english
#!/usr/bin/env ruby
NTW = {
1 => "one",
2 => "two",
3 => "three",
4 => "four",
5 => "five",
6 => "six",
7 => "seven",
@skorks
skorks / integertobetterenglish.rb
Created November 4, 2010 11:36
how integer to english would look if english was more consistent and sane when it comes to naming numbers
#!/usr/bin/env ruby
NTW = {
1 => "one",
2 => "two",
3 => "three",
4 => "four",
5 => "five",
6 => "six",
7 => "seven",
#!/usr/bin/env ruby
=begin
INSTALL:
curl http://github.com/defunkt/gist/raw/master/gist.rb > gist &&
chmod 755 gist &&
sudo mv gist /usr/local/bin/gist
@chriseppstein
chriseppstein / 1_vendor_modules.rake
Created November 6, 2010 19:13
This gist is some helper functions and a rake task that allows you to quickly, safely , and easily vendor modules into your gems.
require 'fileutils'
def subsume_modules(*vendor_modules)
options = vendor_modules.pop
options[:modules] = vendor_modules + Array(options[:additional_modules])
options[:module_names] = options[:modules].map{|m| m.capitalize.gsub(/_[a-z]/){|s| s[-1..-1].upcase}}
vendor_modules.each do |vendor_module|
copy_module vendor_module, options
subsume_module vendor_module, options
end
Come see my teammate Derek Collison talk about the PaaS we've been building at VMware
http://www.rubyconf.org/presentations/8
⚡ $ vmc -h
version # version
help, -h # show usage
/*
* user.watch v1.0: Cross-browser user.watch
* From http://code.eligrey.com/object.watch/
*
* By Elijah Grey, http://eligrey.com
* Tweaked by Trevor Lalish-Menagh, http://trevmex.com
*
* A shim that partially implements object.watch and object.unwatch
* in browsers that have accessor support.
*
@igrigorik
igrigorik / webapp.rb
Created November 13, 2010 21:28
Inspired by @JEG2's talk at Rubyconf... Any ruby object, as a webapp! 'Cause we can. :-)
require 'rubygems'
require 'rack'
class Object
def webapp
class << self
define_method :call do |env|
func, *attrs = env['PATH_INFO'].split('/').reject(&:empty?)
[200, {}, send(func, *attrs)]
end
@chriseppstein
chriseppstein / 1_gradient.sass
Created November 14, 2010 07:37
epic gradients
// you type this
.bg-all-gradient-types
+background-image(image-url("icon.png"), linear-gradient(top left, #ddd, #aaa), radial-gradient(center center, #ddd, #aaa 100px))
$experimental-support-for-svg: true;
@import "compass/css3/version-2";
h1 {
border: 8px solid black;
@include border-image(radial-gradient(#0f0,#f00) 100 stretch);
@include background-image(linear-gradient(#0ff, #00f));
}
@capndesign
capndesign / bookmarklet.js
Created November 16, 2010 04:12 — forked from markpasc/bookmarklet.js
Install this as a bookmarklet and it will show the site's colophon if it uses TypeKit.
javascript:(function(){s=document.createElement('script');s.type='text/javascript';s.src='https://gist.github.com/raw/701397/typekit-colophon.js';document.getElementsByTagName('head').item(0).appendChild(s);void('')})();