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 | |
require 'tempfile' | |
infile = ARGV.shift || 'Makefile' | |
outfile = Tempfile.new(File.basename(__FILE__)) | |
variables = {} | |
begin |
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 TermVector | |
attr_reader :vec | |
private | |
def initialize(vec) | |
@vec = vec | |
end | |
public | |
def self.[](*vals) |
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 | |
conflicts = `git status`.split("\n").collect do |line| | |
md = /both modified:\s+(.*)$/.match(line) | |
md ? md[1] : nil | |
end.compact | |
editor = ENV['EDITOR'] || 'vim' | |
conflicts.each {|path| system("#{editor} #{path}") } |
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 A | |
def foo | |
"okay!" | |
end | |
module B | |
def foo | |
"not " + super | |
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
GIT="`which git`" | |
HG="`which hg`" | |
function checkvcs() { | |
base=$1 | |
if [[ -d "${base}/.git" ]]; then | |
VCS="$GIT" | |
elif [[ -d "${base}/.hg" ]]; then | |
VCS="$HG" | |
else |
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
""" | |
TCP proxy which limits which commands may be forwarded to a MongoDB server | |
Use to enforce read/write/insert-only restrictions | |
Based on protocol docs from the MongoDB wiki: | |
http://www.mongodb.org/display/DOCS/Mongo+Wire+Protocol | |
""" | |
import struct |
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
lennond-mac:~ lennond$ curl -i http://www.sun.com | |
HTTP/1.1 301 Moved Permanently | |
Server: Sun-Java-System-Web-Server/7.0 | |
Date: Thu, 28 Jan 2010 20:21:44 GMT | |
P3p: policyref="http://www.sun.com/p3p/Sun_P3P_Policy.xml", CP="CAO DSP COR CUR ADMa DEVa TAIa PSAa PSDa CONi TELi OUR SAMi PUBi IND PHY ONL PUR COM NAV INT DEM CNT STA POL PRE GOV" | |
Location: http://www.oracle.com | |
Content-length: 0 |
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
--- configure.in.bak 2009-12-17 11:14:31.000000000 -0800 | |
+++ configure.in 2009-12-17 11:14:37.000000000 -0800 | |
@@ -378,7 +378,6 @@ | |
netinet/in.h \ | |
alloca.h \ | |
arpa/inet.h \ | |
-arpa/nameser_compat.h \ | |
arpa/nameser.h \ | |
assert.h \ | |
crypt.h \ |
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
RewriteRule "^/([^\?]+)(&)([^\?]+)(\?)(.*)$" "$1?$3&$5" [R,L] | |
RewriteRule "^/([^\?]+)(&)([^\?]+)$" "$1?$3" [R,L] |
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 scripts_user_revision(object): | |
def __init__(self, message, user=SCRIPTS_USER): | |
self.user = user | |
self.message = message | |
def __call__(self, f): | |
@revision.create_on_success | |
def _decorated(*args): | |
revision.user = self.user | |
revision.comment = self.message |