Skip to content

Instantly share code, notes, and snippets.

View gbenedict's full-sized avatar

Greg Benedict gbenedict

View GitHub Profile
@gbenedict
gbenedict / pow_nip_io.md
Last active April 4, 2017 09:47
Modifying the Pow web server to support nip.io in addition to xip.io

The xip.io DNS servers are proving to be troublesome for both latency and reliability. In researching solutions, I found the nip.io DNS servers to be much more reliable.

This modification to add nip.io support is for version 0.5.0 of Pow.

Go to line 78 of the file ~/Library/Application\ Support/Pow/Current/lib/configuration.js:

this.allDomains.push(/\d+\.\d+\.\d+\.\d+\.xip\.io$/, /[0-9a-z]{1,7}\.xip\.io$/);
@gbenedict
gbenedict / gist:0715b6e58d72560a1800
Last active February 3, 2016 15:49
ActiveRecord Model Style Guide
class Company
# includes
extend FriendlyId
friendly_id :name, use: :slugged
devise :database_authenticatable, :token_authenticatable, :recoverable, :trackable, :invitable, :timeoutable
# constants
TYPES = %w(small medium giantess)
@gbenedict
gbenedict / gist:5417415
Created April 19, 2013 01:07
Fixing a homebrew install of Postgres that won't start.
sudo mkdir /var/pgsql_socket/
sudo ln -s /private/tmp/.s.PGSQL.5432 /var/pgsql_socket/
# initialize the database
initdb /usr/local/var/postgres -E utf8
# start your database
pg_ctl -D /usr/local/var/postgres/data -l logfile start
# setup a db and user for the current Mac user
# First, you need a bundle captured if you haven't already.
heroku bundles:capture
# Second, you need to destroy the old one to create a new one.
# Then you can download the backup.
heroku bundles:destroy `heroku bundles | awk '{print $1}'`
heroku bundles:capture
# give it 1 minute to create the file
sleep 60
heroku bundles:download
wrong number of arguments (2 for 0)
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/gems/actionpack-1.13.6/lib/action_controller/base.rb:334:in `process'
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/gems/actionpack-1.13.6/lib/action_controller/base.rb:334:in `process'
/Library/Ruby/Gems/1.8/gems/rails-1.2.6/lib/dispatcher.rb:41:in `dispatch'
/Library/Ruby/Gems/1.8/gems/passenger-2.2.2/lib/phusion_passenger/railz/request_handler.rb:45:in `process_request'
/Library/Ruby/Gems/1.8/gems/passenger-2.2.2/lib/phusion_passenger/abstract_request_handler.rb:203:in `main_loop'
/Library/Ruby/Gems/1.8/gems/passenger-2.2.2/lib/phusion_passenger/railz/application_spawner.rb:340:in `start_request_handler'
/Library/Ruby/Gems/1.8/gems/passenger-2.2.2/lib/phusion_passenger/railz/application_spawner.rb:298:in `handle_spawn_application'
/Library/Ruby/Gems/1.8/gems/passenger-2.2.2/lib/phusion_passenger/utils.rb:181:in `safe_fork'
/Library/Ruby/Gems/1.8/gems/passenger-2.2.