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
>> Dir.entries('_layouts') | |
=> [".", "..", ".svn"] | |
>> Dir.entries('_layouts').reject { |x| File.directory?(x) } | |
=> [".svn"] | |
>> Dir.chdir('_layouts') | |
=> 0 | |
>> Dir.entries('.') | |
=> [".", "..", ".svn"] | |
>> Dir.entries('.').reject { |x| File.directory?(x) } | |
=> [] |
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
bar |
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 Expr = Sizzle.selectors = { | |
order: [ "ID", "NAME", "TAG" ], | |
match: { | |
ID: /#((?:[\w\u00c0-\uFFFF_-]|\\.)+)/, | |
CLASS: /\.((?:[\w\u00c0-\uFFFF_-]|\\.)+)/, | |
NAME: /\[name=['"]*((?:[\w\u00c0-\uFFFF_-]|\\.)+)['"]*\]/, | |
ATTR: /\[\s*((?:[\w\u00c0-\uFFFF_-]|\\.)+)\s*(?:(\S?=)\s*(['"]*)(.*?)\3|)\s*\]/, | |
TAG: /^((?:[\w\u00c0-\uFFFF\*_-]|\\.)+)/, | |
CHILD: /:(only|nth|last|first)-child(?:\((even|odd|[\dn+-]*)\))?/, | |
POS: /:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^-]|$)/, |
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 'rubygems' | |
require 'rubygems/format' | |
ROOT_DIR = '/home/github/gems/' | |
CACHE_DIR = ROOT_DIR + 'cache' | |
SPEC_DIR = ROOT_DIR + 'specifications' | |
Dir.glob("#{CACHE_DIR}/*.gem") do |f| | |
begin | |
spec = Gem::Format.from_file_by_path(f).spec |
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
foo | |
bar |
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
[18:38][tom@solid:~/dev/mojombo/jekyll(green)]$ rake | |
(in /Users/tom/dev/mojombo/jekyll) | |
Loaded suite /Library/Ruby/Gems/1.8/gems/rake-0.8.3/lib/rake/rake_test_loader | |
Started | |
............................. | |
___________________________________________________________________________ | |
| Maruku tells you: | |
+--------------------------------------------------------------------------- | |
| Malformed HTML starting at "<div class=\"highlight\"><pre><span class=\"nb\">puts</span> <span class=\"s2\">"hi"</span>" | |
| --------------------------------------------------------------------------- |
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
# GitHub Flavored Markdown Layer | |
def fix_markdown_quirks(text) | |
# prevent foo_bar_baz from ending up with an italic word in the middle | |
text.gsub!(/(^(?! {4}|\t)\w+_\w+_\w[\w_]*)/) do |x| | |
x.gsub('_', '\_') if x.split('').sort.to_s[0..1] == '__' | |
end | |
# in very clear cases, let newlines become <br /> tags | |
text.gsub!(/(\A|^$\n)(^\w[^\n]*\n)(^\w[^\n]*$)+/m) do |x| | |
x.gsub(/^(.+)$/, "\\1 ") |
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 config --global sendemail.smtpserver smtp.gmail.com | |
$ git config --global sendemail.smtpserverport 587 | |
$ git config --global sendemail.smtpencryption tls | |
$ git config --global sendemail.smtpuser tom@mojombo.com | |
$ sudo cpan | |
cpan> install Net::SMTP::SSL | |
$ git send-email 0001-whatever.patch |
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
testing permissions 2 3 4 |
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
function psg { | |
ps wwwaux | egrep "($1|%CPU)" | grep -v grep | |
} |