Skip to content

Instantly share code, notes, and snippets.

View kevinelliott's full-sized avatar
🏠
Working from home

Kevin Elliott kevinelliott

🏠
Working from home
View GitHub Profile
@kevinelliott
kevinelliott / rails_session_from_request_header.rb
Created March 22, 2012 02:30
Override session lookup for ActiveRecord::SessionStore::Session to find by session id in request header X_Session_ID, and fallback to default lookup.
module ActionDispatch
module Session
class AbstractStore
# Override the default way to extract the session id
# First check for a X_Session_ID request header, otherwise fallback to cookies/params
def extract_session_id(env)
request = Rack::Request.new(env)
sid = request.env['HTTP_X_SESSION_ID']
sid ||= request.cookies[@key]
sid ||= request.params[@key] unless @cookie_only
@kevinelliott
kevinelliott / osx-10.9-setup.md
Last active November 6, 2020 14:19 — forked from juev/gist:3124344
Clean Install – Mac OS X 10.9 Mavericks

Mac OS X 10.9 Mavericks

Custom recipe to get OS X 10.9 Mavericks running from scratch, setup applications and developer environment. I use this gist to keep track of the important software and steps required to have a functioning system after a semi-annual fresh install.

Install Software

The software selected is software that is "tried and true" --- software I need after any fresh install. I often install other software not listed here, but is handled in a case-by-case basis.

Install from App Store

@kevinelliott
kevinelliott / OSX Development System Maintenance Tasks
Created December 16, 2012 19:08
OSX 10.8 Mountain Lion Development System Maintenance Tasks
#OSX 10.8 Mountain Lion Development System Maintenance Tasks
Tasks necessary to maintain a healthy OSX development system environment. Some tasks should be performed daily, weekly, and monthly.
##Daily
* Empty Trash
* Time Machine is automatically keeping daily backups locally, and a weekly Time Machine backup (automatic when you plug in the Time Machine external drive) will capture these. More frequent Time Machine synchronizations to the external drive could/should occur.
##Weekly
if [ -f "$rvm_path/scripts/rvm" ]; then
source "$rvm_path/scripts/rvm"
if [ -f ".rvmrc" ]; then
source ".rvmrc"
fi
if [ -f ".ruby-version" ]; then
rvm use `cat .ruby-version`
fi
@kevinelliott
kevinelliott / gist:9282848
Last active January 20, 2017 00:55
Sublime Text 3 Setup

Themes

  • Soda
  • RailsCasts Colour Scheme

Fonts

  • Source Code Pro, size 12

Plugins

@kevinelliott
kevinelliott / osx-10.10-setup.md
Last active December 1, 2023 08:21
Mac OS X 10.10 Yosemite Setup

Mac OS X 10.10 Yosemite

Custom recipe to get OS X 10.10 Yosemite running from scratch, setup applications and developer environment. I use this gist to keep track of the important software and steps required to have a functioning system after a semi-annual fresh install. On average, I reinstall each computer from scratch every 6 months, and I do not perform upgrades between distros.

This keeps the system performing at top speeds, clean of trojans, spyware, and ensures that I maintain good organizational practices for my content and backups. I highly recommend this.

You are encouraged to fork this and modify it to your heart's content to match your own needs.

Install Software

Business Models

Advertising

Models Examples
Display ads Yahoo!
Search ads Google
@kevinelliott
kevinelliott / import_mysql_db
Created February 26, 2015 23:42
Simple bash script to drop a mysql database, create the database, and then import it using pv to display progress of the large import
#!/bin/sh
#
# import_mysql_db - Drops the database and then imports it from sql file
#
# 2015-02-26, Kevin Elliott, kevin@catalyzed.io
#
if [ $# -ne 3 ];
then
echo "syntax: import_mysql_db <database_user> <database_name> <sql_file>";
@kevinelliott
kevinelliott / osx-10.11-setup.md
Last active April 10, 2022 15:47
Mac OS X 10.11 El Capitan Setup

Mac OS X 10.11 El Capitan

Custom recipe to get OS X 10.11 El Capitan running from scratch, setup applications and developer environment. This is very similar (and currently mostly the same) as my 10.10 Yosemite setup recipe (as found on this gist https://gist.github.com/kevinelliott/0726211d17020a6abc1f). Note that I expect this to change significantly as I install El Capitan several times.

I use this gist to keep track of the important software and steps required to have a functioning system after a semi-annual fresh install. On average, I reinstall each computer from scratch every 6 months, and I do not perform upgrades between distros.

This keeps the system performing at top speeds, clean of trojans, spyware, and ensures that I maintain good organizational practices for my content and backups. I highly recommend this.

You are encouraged to fork this and modify it to your heart's content to match your own needs.