This file contains hidden or 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
test 1 | |
Forking trevor's gist |
This file contains hidden or 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
from http://radar.oreilly.com/2008/11/why-i-like-twitter.html | |
"There's a real lesson to Facebook here about giving other services (like Twitter) access to their social graph. They have the best one going, but because they try to keep users coming back to their interface, and even the applications built on their service have to live in Facebook, they end up as a ghetto rather than a true internet service. It's the data, not the interface! Let other people use your data, build on it, and it will still belong to you. Hold it too tight, and they will compete with it." | |
This file contains hidden or 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
function parse_git_dirty { | |
git diff --quiet || echo "•" | |
} | |
function parse_git_branch { | |
ref=$(git symbolic-ref HEAD 2> /dev/null) || return | |
echo "["${ref#refs/heads/}"$(parse_git_dirty)]" | |
} | |
YELLOW="\[\033[0;33m\]" |
This file contains hidden or 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
(function($) { | |
$.fn.imageAsync = function(options) { | |
var settings = $.extend({}, $.fn.imageAsync.defaults, options); | |
return this.each(function() { | |
if( $(this).attr('src') ) { | |
var originalImageSrc = $(this).attr('src'); |
This file contains hidden or 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
### /lib/rack/sass ### | |
require 'sass' | |
module Rack | |
class Sass < Rack::File | |
def initialize(root, options = {}) | |
@root = root | |
@options = options | |
end | |
This file contains hidden or 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
# Lighter -- Campfire from the command line | |
# usage: ruby lighter.rb subdomain "Main Room" macournoyer@gmail | |
require "rubygems" | |
require "tinder" | |
require "readline" | |
require "highline/import" | |
class Lighter | |
def initialize(room) | |
@room = room |
This file contains hidden or 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
# http://www.flickr.com/groups/api/discuss/72157616713786392/ | |
# manufacturing flic.kr style photo URLs | |
module Base58 | |
def self.encode(n) | |
alphabet = %w( | |
1 2 3 4 5 6 7 8 9 | |
a b c d e f g h i | |
j k m n o p q r s | |
t u v w x y z A B |
This file contains hidden or 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
#forked to fix error in the original | |
require 'rubygems' | |
require 'sinatra' | |
helpers do | |
def subdomains(tld_len=1) # we set tld_len to 1, use 2 for co.uk or similar | |
@subdomains ||= if (request.host.nil? || | |
/\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/.match(request.host)) | |
[] |
This file contains hidden or 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
DOMAIN.COM. 1800 IN SOA ns15.domaincontrol.com. dns.jomax.net. ( | |
2010090822 | |
28800 | |
7200 | |
604800 | |
86400 | |
) | |
; A Records | |
@ 1800 IN A 174.129.212.2 |
This file contains hidden or 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
// Ported from Stefan Gustavson's java implementation | |
// http://staffwww.itn.liu.se/~stegu/simplexnoise/simplexnoise.pdf | |
// Read Stefan's excellent paper for details on how this code works. | |
// | |
// Sean McCullough [email protected] | |
/** | |
* You can pass in a random number generator object if you like. | |
* It is assumed to have a random() method. | |
*/ |
OlderNewer