Skip to content

Instantly share code, notes, and snippets.

View prpetten's full-sized avatar

Paul Pettengill prpetten

View GitHub Profile
@chetan
chetan / yardoc_cheatsheet.md
Last active May 10, 2024 02:53
YARD cheatsheet
@dvydra
dvydra / gist:3422479
Created August 22, 2012 05:23
Click on filename in terminal and open file in rubymine
1) Install iTerm2, it's awesome.
2) locate your rubymine commandline integration thingy, it's usually `/usr/local/bin/mine`
3) Open iTerm2 preferences. Go to Profiles -> Default -> Advanced.
4) Select "Run command..." under Semantic History
5) Enter "/usr/local/bin/mine --line \2 \1" as the command
@roseleaf
roseleaf / enable_direct_lines.rb
Created August 9, 2013 23:26
This script solves the complex problem of setting all phone numbers on "real" user profiles to direct_line, while disabling direct lines on all "dummy" profiles that have the same number. working around the issue of direct lines being unique, and of each user being required to have at least one valid "identity" (such as a direct_line phone numbe…
# This script solves the complex problem of setting all phone numbers on
# "real" user profiles to direct_line, while disabling direct lines on all
# "dummy" profiles that have the same number. working around the issue of
# direct lines being unique, and of each user being required to have at least
# one valid "identity" (such as a direct_line phone number or an email address)
# by: 1) finding all users who do not have profiles but who do have phone
# numbers and setting their emails to dummy values associated with those
# numbers in order to un-set the "direct_line" property on their numbers.
# 2) setting aside all users that do have profiles and setting their numbers
# to direct_line.
@julionc
julionc / 00.howto_install_phantomjs.md
Last active May 30, 2024 16:08
How to install PhantomJS on Debian/Ubuntu

How to install PhantomJS on Ubuntu

Version: 1.9.8

Platform: x86_64

First, install or update to the latest system software.

sudo apt-get update
sudo apt-get install build-essential chrpath libssl-dev libxft-dev
@Integralist
Integralist / features support env.rb
Created February 14, 2014 11:05
Variety of different Capybara configurations, tips and tricks
Capybara.default_wait_time = 20
Capybara.default_host = DEFAULT_HOST
Capybara.app = Capybara.app_host = DEFAULT_HOST
Capybara.configure do |config|
config.match = :prefer_exact
config.ignore_hidden_elements = false
end
Capybara.run_server = false
@hopsoft
hopsoft / db.rake
Last active May 22, 2024 22:53
Rails rake tasks for dump & restore of PostgreSQL databases
# lib/tasks/db.rake
namespace :db do
desc "Dumps the database to db/APP_NAME.dump"
task :dump => :environment do
cmd = nil
with_config do |app, host, db, user|
cmd = "pg_dump --host #{host} --username #{user} --verbose --clean --no-owner --no-acl --format=c #{db} > #{Rails.root}/db/#{app}.dump"
end
puts cmd