Skip to content

Instantly share code, notes, and snippets.

View saveologypaul's full-sized avatar

Paul Kruger saveologypaul

View GitHub Profile
@saveologypaul
saveologypaul / iterm2.md
Created March 13, 2012 14:25 — forked from sockmonk/iterm2.md
iterm2 cheatsheet
Function Shortcut
previous tab ⌘ + left arrow
next tab ⌘ + right arrow
go to tab ⌘ + number
go to window ⌘ + Option + Number
go to split pane by direction ⌘ + Option + arrow
go to split pane by order of use ⌘ + ] , ⌘ + [
split window horizontally (same profile) ⌘ + D
split window vertically (same profile) ⌘ + d
@saveologypaul
saveologypaul / Error
Created April 4, 2012 22:04 — forked from NickClark/Error
Deployment Gemfile.lock woes
You are trying to install in deployment mode after changing
your Gemfile. Run `bundle install` elsewhere and add the
updated Gemfile.lock to version control.
You have deleted from the Gemfile:
* guard-pow
* rb-fsevent
@saveologypaul
saveologypaul / speeding_up_spork.rb
Created April 5, 2012 17:57 — forked from mcmire/speeding_up_spork.rb
Patch to speed up Spork
# Don't reload views or routes
# This (along with setting cache_classes to false) brought running a
# single spec file down from 7.4s to 2.8s
# See discussion: http://github.com/timcharper/spork/issues#issue/13
#
# To install, put this in spec/support and then require it in your spec_helper like:
#
# require 'spork'
# require File.expand_path(File.dirname(__FILE__) + "/support/spork")
#
@saveologypaul
saveologypaul / deploy.rake
Created April 6, 2012 14:17 — forked from njvitto/deploy.rake
Rakefile to deploy and rollback to Heroku in two different environments (staging and production) for the same app
#Deploy and rollback on Heroku in staging and production
task :deploy_staging => ['deploy:set_staging_app', 'deploy:push', 'deploy:restart', 'deploy:tag']
task :deploy_production => ['deploy:set_production_app', 'deploy:push', 'deploy:restart', 'deploy:tag']
namespace :deploy do
PRODUCTION_APP = 'YOUR_PRODUCTION_APP_NAME_ON_HEROKU'
STAGING_APP = 'YOUR_STAGING_APP_NAME_ON_HEROKU'
task :staging_migrations => [:set_staging_app, :push, :off, :migrate, :restart, :on, :tag]
task :staging_rollback => [:set_staging_app, :off, :push_previous, :restart, :on]
@saveologypaul
saveologypaul / gist:2492746
Created April 25, 2012 19:41 — forked from bkimble/gist:1365005
List local memcached keys using Ruby
#!/usr/bin/env ruby
require 'net/telnet'
cache_dump_limit = 100
localhost = Net::Telnet::new("Host" => "localhost", "Port" => 11211, "Timeout" => 3)
slab_ids = []
localhost.cmd("String" => "stats items", "Match" => /^END/) do |c|
matches = c.scan(/STAT items:(\d+):/)
slab_ids = matches.flatten.uniq
end
@saveologypaul
saveologypaul / deploy.rake
Created April 27, 2012 13:50 — forked from njvitto/deploy.rake
Rakefile to deploy and rollback to Heroku in two different environments (staging and production) for the same app
#Deploy and rollback on Heroku in staging and production
task :deploy_staging => ['deploy:set_staging_app', 'deploy:push', 'deploy:restart', 'deploy:tag']
task :deploy_production => ['deploy:set_production_app', 'deploy:push', 'deploy:restart', 'deploy:tag']
namespace :deploy do
PRODUCTION_APP = 'YOUR_PRODUCTION_APP_NAME_ON_HEROKU'
STAGING_APP = 'YOUR_STAGING_APP_NAME_ON_HEROKU'
task :staging_migrations => [:set_staging_app, :push, :off, :migrate, :restart, :on, :tag]
task :staging_rollback => [:set_staging_app, :off, :push_previous, :restart, :on]
@saveologypaul
saveologypaul / capybara_save_and_open_page.rb
Created May 2, 2012 15:41 — forked from snelson/capybara_save_and_open_page.rb
Rails 3.1 Capybara save_and_open_page asset pipeline support
if Rails.version.to_f >= 3.1 and Rails.application.config.assets.enabled
require 'capybara/util/save_and_open_page'
module Capybara
class << self
def save_page(html, file_name=nil)
rewrite_css_assets
save_page_html(html, file_name)
end
protected
var setCryptData = function (data) {
window.cryptData = data.crypto_key;
};
var submitFormWithCrypto = function (form, callback) {
$.getScript('/profiles/crypto_key?callback=setCryptData', function () {
var queryData = {
key_id: cryptData.id,
encrypted: teaEncrypt($(form).serialize(), cryptData.key)
};
require 'spec_helper'
describe FeaturePool do
it "creates a new instance given valid attributes" do
Fabricate :feature_pool
end
it "is not valid without a name" do
Fabricate.build(:feature_pool, :name => "").should_not be_valid
end