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 / keybase.md
Last active October 2, 2016 22:53
keybase.md

Keybase proof

I hereby claim:

  • I am kevinelliott on github.
  • I am kevinelliott (https://keybase.io/kevinelliott) on keybase.
  • I have a public key whose fingerprint is F82D BBB7 B582 2B54 D451 B7D5 FE1B A54C 7269 D619

To claim this, I am signing this object:

@kevinelliott
kevinelliott / setup-ubuntu-15.10-dev.sh
Last active October 2, 2016 22:54
Setup standard development environment on Ubuntu 15.10
#!/bin/bash
#
# setup-ubuntu-15.10-dev.sh - Setup standard development environment on Ubuntu 15.10
#
# Kevin Elliott <kevin@catalyzed.io>
#
echo "=== Installing OpenConnect and the Network Manager support ==="
sudo apt-get install openconnect network-manager-openconnect-gnome
echo

Business Models

Advertising

Models Examples
Display ads Yahoo!
Search ads Google
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 / heroku_env_copy.sh
Created December 8, 2017 17:58 — forked from jamesr2323/heroku_env_copy.sh
Script to copy environment variables from an existing heroku app to another one
#!/bin/bash
# Source: http://blog.nonuby.com/blog/2012/07/05/copying-env-vars-from-one-heroku-app-to-another/
set -e
sourceApp="$1"
targetApp="$2"
config=""
@kevinelliott
kevinelliott / 177
Last active April 23, 2019 03:28
ST Transmissions
Welcome, Hunter.
This message should reach you at the middle of the fourth month of your calendar year, in the year 2019. If you are reading this, something has led you to search for things which bring excitement to an otherwise predictable world.
What you are reading is the first clue in a grand Hunt. It is not the first Hunt, nor of course will it be the last one, but this hunt is MINE, and so it is to me that you must prove yourself.
The treasure which will belong to the most successful Hunters and their clan is neither gold, nor jewels, nor the pieces of worthless paper that pass for money in this sad age; instead it is Bitcoin, a digital treasure forged from deep mathematical truths, in an amount equal to 1 million USD.
I have shattered this Bitcoin treasure into one thousand pieces, using the splitting magic of the wizard Shamir. To reassemble it, you or your clan must find exactly four hundred of the pieces, and meld them back together using Shamir's spell of recombination. Once you have done so,
@kevinelliott
kevinelliott / Sat Message Types
Last active April 23, 2019 03:31
Downloaded each sat message and ran it through file on the CLI.
messages/122: PNG image data, 128 x 32, 8-bit/color RGBA, non-interlaced
messages/123: ASCII text, with CRLF line terminators
messages/124: PGP message
messages/125: PNG image data, 75 x 75, 8-bit/color RGB, non-interlaced
messages/126: ASCII text
messages/127: ASCII text, with no line terminators
messages/128: ASCII text, with very long lines, with no line terminators
messages/129: ASCII text, with no line terminators
messages/130: ASCII text, with very long lines, with no line terminators
messages/131: ASCII text, with very long lines, with CRLF line terminators