Discover gists
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
This is an authenticated test |
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 ruby | |
# Made by Pieter de Bie <frimmirf@gmail.com> | |
# Based on a "Pastie" task by someone | |
require "tempfile" | |
GIST_URL = 'http://gist.github.com/gists' | |
GIST_LOGIN_URL = 'https://gist.github.com/session' | |
USERNAME = "pieter" | |
TOKEN = "SweetTokenPower" |
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
http://thesaurus.reference.com/browse/thesaurus |
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 | |
# earl, 2008-07-22 | |
from __future__ import with_statement | |
import stringtemplate3, simplejson, sys | |
def main(): | |
with open(sys.argv[1]) as template_file: | |
template = stringtemplate3.StringTemplate(template_file.read()) | |
template.attributes = simplejson.load(sys.stdin) | |
sys.stdout.write(unicode(template).encode('utf-8')) |
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 | |
# earl, 2008-07-22 | |
from __future__ import with_statement | |
import stringtemplate3, simplejson, sys | |
def main(): | |
with open(sys.argv[1]) as template_file: | |
template = stringtemplate3.StringTemplate(template_file.read()) | |
template.attributes = simplejson.load(sys.stdin) | |
sys.stdout.write(unicode(template).encode('utf-8')) |
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
# user and group to run as | |
user abcde abcde; | |
# number of nginx workers | |
worker_processes 4; | |
# pid of nginx master process | |
pid /var/run/nginx.pid; | |
# Number of worker connections. 1024 is a good default |
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 Object | |
def try(method, *args, &block) | |
respond_to?(method) ? send(method, *args, &block) : nil | |
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
#!/usr/bin/ruby | |
ARGV.each { |arg| | |
printf("%s\n", Regexp.escape(arg)) | |
} |
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 Proc | |
def curry(*arguments) | |
if arguments.empty? | |
return self | |
else | |
_proc = self.dup | |
return lambda do |*args| | |
return _proc.call(*arguments.concat(args)) | |
end | |
end |