Skip to content

Instantly share code, notes, and snippets.

View martinisoft's full-sized avatar
🍎
Makin' Cider & Writing Code

Aaron Kalin martinisoft

🍎
Makin' Cider & Writing Code
View GitHub Profile
@martinisoft
martinisoft / regext.txt
Created August 23, 2011 02:35 — forked from jt/regext.txt
Regular expression notes
- any character you use it will literally match it except special characters
^ $ ? . / \ [ ] { } ( ) + * - all the special characters that will need escaping if you don't want them to be special
// - regexp ruby class
Common Patterns (I authored)
/[\w+\.~-]+@[\w~-]+.[\w\.]+/ - match emails, conforms to RFC 3986 section 3.3
/\+?(\d)?[-|\.|\s]?\(?(\d{3})\)?[-|\.|\s]?(\d{3})[-|\.|\s]?(\d{4})/ - match phone numbers, https://gist.github.com/1009331
Strategies
run("echo group :test, :development do >> Gemfile;")
run("echo gem \\'rspec-rails\\', \\'\\>\\= 2.3.0\\' >> Gemfile;")
run("echo gem \\'capybara\\', \\'0.3.9\\' >> Gemfile;")
run("echo gem \\'database_cleaner\\' >> Gemfile;")
run("echo gem \\'cucumber-rails\\' >> Gemfile;")
run("echo gem \\'launchy\\' >> Gemfile;")
run("echo end >> Gemfile;")
run("bundle install")
@martinisoft
martinisoft / gistie.rb
Created September 23, 2008 06:29 — forked from pieter/gistie.rb
command-line posting to gist
#!/usr/bin/env ruby
# Made by Pieter de Bie <[email protected]>
# 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 = "martinisoft"
TOKEN = "6ef8395fecf207165f1a82178ae1b984"