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
$:.unshift(`brew --prefix`.chomp+'/Library/Homebrew') | |
require 'global' | |
Formula.each do |f| | |
p f | |
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
#!/bin/sh | |
# Just copy and paste the lines below (all at once, it won't work line by line!) | |
# MAKE SURE YOU ARE HAPPY WITH WHAT IT DOES FIRST! THERE IS NO WARRANTY! | |
function abort { | |
echo "$1" | |
exit 1 | |
} | |
set -e |
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
#define TDURLRegularExpression "(?i)\\b((?:https?://|www\\d{0,3}[.]|[a-z0-9.\\-]+[.][a-z]{2,4}/)(?:[^\\s()<>]+|\\(([^\\s()<>]+|(\\([^\\s()<>]+\\)))*\\))+(?:\\(([^\\s()<>]+|(\\([^\\s()<>]+\\)))*\\)|[^\\s`!()\\[\\]{};:'\".,<>?\u00AB\u00BB\u201C\u201D\u2018\u2019]))" |
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 | |
# The Ruby FizzBuzz with the best concision versus elegance compromise. | |
# Fork if you have better ideas. | |
1.upto 100 do |n| | |
puts [[:fizz][n%3], [:buzz][n%5]].join[/.+/m] || n | |
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
#import <Foundation/Foundation.h> | |
@interface NSURLRequest (mxcl) | |
+ (id)requestWithURL:(NSURL *)url; | |
+ (id)requestWithURL:(NSURL *)url cachePolicy:(NSURLRequestCachePolicy)cachePolicy timeoutInterval:(NSTimeInterval)timeoutInterval; | |
+ (id)requestWithURLString:(NSString *)url; // for convenience | |
@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
<?xml version="1.0" encoding="UTF-8"?> | |
<scheme name="Colbalt" version="1" parent_scheme="Default"> | |
<option name="LINE_SPACING" value="1.1" /> | |
<option name="EDITOR_FONT_SIZE" value="12" /> | |
<option name="EDITOR_FONT_NAME" value="Monaco" /> | |
<colors> | |
<option name="CARET_COLOR" value="ffffff" /> | |
<option name="CARET_ROW_COLOR" value="133d61" /> | |
<option name="FOLDING_TREE_COLOR" value="466a8a" /> | |
<option name="INDENT_GUIDE" value="123b5f" /> |
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 | |
RED = "\033[0;31m" | |
RESET = "\033[0m" | |
YELLOW = "\033[0;33m" | |
BLUE = "\033[0;35m" | |
GREY = "\033[0;34m" | |
trap("INT") { puts; exit! 127 } |
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
def inreplace path, before=nil, after=nil | |
[*path].each do |path| | |
f = File.open path, 'r' | |
s = f.read.gsub before, after | |
f.reopen(path, 'w').write s | |
f.close | |
end | |
end | |
require 'pathname' |
“A human being should be able to change a diaper, plan an invasion, butcher a hog, conn a ship, design a building, write a sonnet, balance accounts, build a wall, set a bone, comfort the dying, take orders, give orders, cooperate, act alone, solve equations, analyze a new problem, pitch manure, program a computer, cook a tasty meal, fight efficiently, die gallantly. Specialization is for insects.”
I think it's from “The moon is a harsh mistress”