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
class Array | |
def to_json(options = {}, &block) #:nodoc: | |
"[#{map { |value| ActiveSupport::JSON.encode(value, options, &block) } * ', '}]" | |
end | |
end | |
module ActiveSupport | |
module JSON |
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
use Cache::Memcached; | |
use IO::Socket::INET; | |
my $testaddr = "127.0.0.1:22122"; | |
my $msock = IO::Socket::INET->new(PeerAddr => $testaddr, | |
Timeout => 3); | |
my $memd = Cache::Memcached->new({ | |
servers => [ $testaddr ] | |
}); |
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
// ==UserScript== | |
// @name Fix tabs in gist paste. | |
// @namespace Gist | |
// @description nukes tabs | |
// @include http://gist.github.com/ | |
// ==/UserScript== | |
var jQuery = unsafeWindow.jQuery; | |
$ = jQuery | |
$('.paste').prepend('<a href="#" id="fix_the_fucking_tabs">fix the fucking tabs</a>'); |
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
$('#file').change(function() { | |
$("#uploader").ajaxForm({iframe: true, success: success}).submit(); | |
}) |
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
var CurbedNetwork = $H({ | |
'curbed.com': $H({ | |
title: 'curbed', | |
locale: 'ny', | |
name: 'Curbed', | |
email: '[email protected]' | |
}), | |
'eater.com': $H({ | |
title: 'eater', | |
locale: 'ny', |
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
# .irbrc | |
# <snip> | |
class Object | |
def self.pbcopy(val) | |
IO.popen('pbcopy','w') {|pb| pb << val } | |
end | |
def pbcopy |
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
trapper:ext dusty$ make | |
gcc -I. -I. -I/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/universal-darwin9.0 -I. -DHAVE_RUBY_H -DHAVE_ASPELL_H -I/opt/local/include -fno-common -arch ppc -arch i386 -Os -pipe -fno-common -c raspell.c | |
cc -arch ppc -arch i386 -pipe -bundle -undefined dynamic_lookup -o raspell.bundle raspell.o -L. -L/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib -L/opt/local/lib -L. -arch ppc -arch i386 -lruby -laspell -lpthread -ldl -lm | |
ld warning: in /opt/local/lib/libaspell.dylib, file is not of required architecture | |
trapper:ext dusty$ which ruby | |
/usr/bin/ruby | |
trapper:ext dusty$ ruby | |
Makefile extconf.rb mkmf.log raspell.bundle raspell.c raspell.h raspell.o | |
trapper:ext dusty$ irb | |
irb(main):001:0> require 'raspell' |
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
import deliciousapi | |
import random | |
import urllib | |
import ConfigParser | |
import os.path | |
class RandomDeliciousLink(object): | |
def __init__(self, pinboard_username, pinboard_password, | |
instapaper_username, instapaper_password): | |
self.pinboard_username = pinboard_username |
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
class Constants | |
@myConst: () -> "Hello" | |
exports.Constants = Constants |
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 'socket' | |
class Graphite | |
def initialize(host) | |
@host = host | |
end | |
def socket | |
return @socket if @socket && [email protected]? | |
@socket = TCPSocket.new(@host, 2003) |
OlderNewer