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
find . -type f -name "*.pyc" -exec rm -f {} \; |
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
:%s'replacethis'withthis'gc |
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 | |
a = ARGV[0] | |
i = 1 | |
until i == 256 | |
o = a + i.to_s | |
puts o | |
i += 1 | |
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
desc "Run spork" | |
task :spork do | |
sh %{bundle exec spork > /dev/null 2>&1 &} | |
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
minooka; diff -c /n/dump/2010/0930/sys/src/9/ip/ip.c /n/dump/2010/0820/sys/src/9/ip/ip.c | |
/n/dump/2010/0930/sys/src/9/ip/ip.c:463,469 - /n/dump/2010/0820/sys/src/9/ip/ip.c:463,469 | |
} | |
/* don't forward to source's network */ | |
- memset(&conv, 0, sizeof conv); | |
+ conv.r = nil; | |
r = v4lookup(f, h->dst, &conv); | |
if(r == nil || r->ifc == ifc){ | |
ip->stats[OutDiscards]++; |
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
# | |
# RFC822 Email Address Regex | |
# -------------------------- | |
# | |
# Originally written by Cal Henderson | |
# c.f. http://iamcal.com/publish/articles/php/parsing_email/ | |
# | |
# Translated to Ruby by Tim Fletcher, with changes suggested by Dan Kubb. | |
# | |
# Licensed under a Creative Commons Attribution-ShareAlike 2.5 License |
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
middle_name = case full_name | |
when /^.*\s(.*)\s.*$/ | |
$1 | |
else | |
"Peatrice" | |
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
>> "https://www.google.com/dir/1/2/search.html?arg=0-a&arg1=1-b&arg3-c#hash".match /^((http[s]?|ftp):\/)?\/?([^:\/\s]+)((\/\w+)*\/)([\w\-\.]+[^#?\s]+)(.*)?(#[\w\-]+)?$/ | |
=> #<MatchData "https://www.google.com/dir/1/2/search.html?arg=0-a&arg1=1-b&arg3-c#hash" 1:"https:/" 2:"https" 3:"www.google.com" 4:"/dir/1/2/" 5:"/2" 6:"search.html" 7:"?arg=0-a&arg1=1-b&arg3-c#hash" 8:nil> | |
>> "ftp://ftp1.freebsd.org/pub/FreeBSD/ports/i386/packages-8.2-release/All/".match /^((http[s]?|ftp):\/)?\/?([^:\/\s]+)((\/\w+)*\/)([\w\-\.]+[^#?\s]+)(.*)?(#[\w\-]+)?$/ | |
=> #<MatchData "ftp://ftp1.freebsd.org/pub/FreeBSD/ports/i386/packages-8.2-release/All/" 1:"ftp:/" 2:"ftp" 3:"ftp1.freebsd.org" 4:"/pub/FreeBSD/ports/i386/" 5:"/i386" 6:"packages-8.2-release/All/" 7:"" 8:nil> | |
>> u = "ftp://ftp1.freebsd.org/pub/FreeBSD/ports/i386/packages-8.2-release/All/".match /^((http[s]?|ftp):\/)?\/?([^:\/\s]+)((\/\w+)*\/)([\w\-\.]+[^#?\s]+)(.*)?(#[\w\-]+)?$/ | |
=> #<MatchData "ftp://ftp1.freebsd.org/pub/FreeBSD/ports/i386/packages-8.2-release/All/" 1:"ftp: |
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 | |
### BEGIN INIT INFO | |
# Provides: redis-server | |
# Required-Start: $syslog | |
# Required-Stop: $syslog | |
# Should-Start: $local_fs | |
# Should-Stop: $local_fs | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: 0 1 6 | |
# Short-Description: redis-server - Persistent key-value db |
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
rails_root = File.expand_path('../../', __FILE__) | |
$LOAD_PATH.unshift(rails_root) unless $LOAD_PATH.include?(rails_root) | |
require 'bundler/setup' | |
require 'active_record' | |
require 'rspec/rails/extensions/active_record/base' | |
require 'spec/support/require_helper' | |
require 'spec/support/helpers' | |
require 'ostruct' | |
Bundler.require :models |
OlderNewer