Skip to content

Instantly share code, notes, and snippets.

View san983's full-sized avatar

Santiago Traversa san983

View GitHub Profile
@zhengjia
zhengjia / capybara cheat sheet
Created June 7, 2010 01:35
capybara cheat sheet
=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')
@erichurst
erichurst / database.yml.example mysql2
Created May 9, 2011 02:58
Rails 3 database.yml examples
# MySQL. Versions 4.1 and 5.0 are recommended.
#
# Install the MySQL driver:
# gem install mysql2
#
# And be sure to use new-style password hashing:
# http://dev.mysql.com/doc/refman/5.0/en/old-client.html
development:
adapter: mysql2
encoding: utf8
@niallo
niallo / gist:3109252
Created July 14, 2012 04:54
Parse Github `Links` header in JavaScript
/*
* parse_link_header()
*
* Parse the Github Link HTTP header used for pageination
* http://developer.github.com/v3/#pagination
*/
function parse_link_header(header) {
if (header.length == 0) {
throw new Error("input must not be of zero length");
}
@sxua
sxua / 0-readme.md
Created October 13, 2012 16:14 — forked from burke/0-readme.md
ruby-1.9.3-p286 cumulative performance patch.

Patch for ruby 1.9.3-p327 is here: https://gist.github.com/4063779

Patched ruby 1.9.3-p286 for 30% faster rails boot

Overview

This script installs a patched version of ruby 1.9.3-p286 with boot-time performance improvements (#66 and #68), and runtime performance improvements (#83 and #84). It also includes the new backported GC from ruby-trunk.

Many thanks to funny-falcon for the performance patches.

@colmarius
colmarius / tmux-tmuxinator-setup.md
Last active May 16, 2024 02:27
Project start/stop with tmux + tmuxinator

1. Install tmux + tmuxinator

gem install tmuxinator

2. Add ~/.tmuxinator project specific configurations

# File: ~/.tmuxinator/project-name.yml

name: project-name
@bbasata
bbasata / gist:5c5ec40650371e62e970
Last active August 29, 2015 14:19
twitter-pairing with @magnusstahre
SUBMODULE=lib/ansible/modules/core
SUBMODULE_COMMIT=4d9ce9cf2cdee14b1c417e92059d4ef83dbcc457
for superproject_tag in $(git tag); do
git ls-tree -r $superproject_tag | grep $SUBMODULE | awk '{ print $3 }' | while read submodule_commit_in_superproject_tag; do
(cd $SUBMODULE && git rev-list $submodule_commit_in_superproject_tag | grep $SUBMODULE_COMMIT >/dev/null && echo "Found submodule commit in superproject tag $superproject_tag")
done
done
@PratheepV
PratheepV / seed_fu_enabling_validation_hack.rb
Created September 5, 2015 06:12
To enable validations on seed fu
module SeedFu
class Seeder
private
def seed_record(data)
record = find_or_initialize_record(data)
return if @options[:insert_only] && !record.new_record?
puts " - #{@model_class} #{data.inspect}" unless @options[:quiet]
# Rails 3 or Rails 4 + rails/protected_attributes
#!/usr/bin/env bash
# Original Source: http://blog.nonuby.com/blog/2012/07/05/copying-env-vars-from-one-heroku-app-to-another/
## Usage: heroku_env_copy [options] SOURCE TARGET
##
## NOTE: This script will only output the command, you should run it yourself.
##
## Options:
## -h, --help Display this message.
##