Get Homebrew installed on your mac if you don't already have it
Install highlight. "brew install highlight". (This brings down Lua and Boost as well)
states = <<STATES | |
28,AC,Acre | |
28,AL,Alagoas | |
28,AP,Amapá | |
28,AM,Amazonas | |
28,BA,Bahia | |
28,CE,Ceará | |
28,ES,Espírito Santo | |
28,GO,Goiás | |
28,MA,Maranhão |
=Navigating= | |
visit('/projects') | |
visit(post_comments_path(post)) | |
=Clicking links and buttons= | |
click_link('id-of-link') | |
click_link('Link Text') | |
click_button('Save') | |
click('Link Text') # Click either a link or a button | |
click('Button Value') |
function slugify(text) | |
{ | |
return text.toString().toLowerCase() | |
.replace(/\s+/g, '-') // Replace spaces with - | |
.replace(/[^\w\-]+/g, '') // Remove all non-word chars | |
.replace(/\-\-+/g, '-') // Replace multiple - with single - | |
.replace(/^-+/, '') // Trim - from start of text | |
.replace(/-+$/, ''); // Trim - from end of text | |
} |
#!/bin/bash | |
# This way you can customize which branches should be skipped when | |
# prepending commit message. | |
if [ -z "$BRANCHES_TO_SKIP" ]; then | |
BRANCHES_TO_SKIP=(master develop test) | |
fi | |
BRANCH_NAME=$(git symbolic-ref --short HEAD) | |
BRANCH_NAME="${BRANCH_NAME##*/}" |
Get Homebrew installed on your mac if you don't already have it
Install highlight. "brew install highlight". (This brings down Lua and Boost as well)
function countCSSRules() { | |
var results = '', | |
log = ''; | |
if (!document.styleSheets) { | |
return; | |
} | |
for (var i = 0; i < document.styleSheets.length; i++) { | |
countSheet(document.styleSheets[i]); | |
} | |
function countSheet(sheet) { |
source :rubygems | |
gem 'shotgun', :group=>:development | |
gem 'rack-cache' | |
gem 'sinatra', :require => 'sinatra/base' | |
gem 'sinatra-support' | |
gem 'haml' |
require.config({ | |
baseUrl: '/backbone-tests/', | |
paths: { | |
'jquery' : '/app/libs/jquery', | |
'underscore' : '/app/libs/underscore', | |
'backbone' : '/app/libs/backbone', | |
'mocha' : 'libs/mocha', | |
'chai' : 'libs/chai', | |
'chai-jquery' : 'libs/chai-jquery', | |
'models' : '/app/models' |
$(function(){ | |
var tokenValue = $("meta[name='csrf-token']").attr('content'); | |
$.ajaxSetup({ | |
headers: {'X-CSRF-Token': tokenValue} | |
}); | |
}) |
#Postgresql 9.2.1 Compilation instructions for Ubuntu 12.04 | |
#This will install Postgresql 9.2.1 into /usr/local/postgresql-9.2.1 | |
#This assumes that you have sudo provileges on the machine installing postgresql | |
#It should work by copying and pasting into the shell, I haven't tested it, I just summarized | |
#what I just did and it worked | |
#Get requirements | |
sudo apt-get install build-essential libreadline6-dev zlib1g-dev |