Skip to content

Instantly share code, notes, and snippets.

@jessieay
jessieay / gist:11057713
Created April 18, 2014 18:23
The X of X List
Xerox
Groupon
Kleenex
namespace :ckeditor do
desc 'Create nondigest versions of all ckeditor digest assets'
task :create_nondigest_assets do
fingerprint = /\-([0-9a-f]{32})\./
for file in Dir['public/assets/ckeditor/**/*']
next unless file =~ fingerprint
nondigest = file.sub(fingerprint, '.')
filename = nondigest.sub('public/assets/', '').sub(/.gz$/, '')
@jessieay
jessieay / til_9_20_2016.md
Last active September 20, 2016 22:09
A GitHub lesson, and a Rails lesson (for Heroku and Cloud Foundry)

Lessons learned are enumerated at the bottom for those who want the tl;dr

Background:

Lately, I've noticed that the Rails app I am working on does this funny little thing where it logs everyone out every time we deploy. Sorry, ppl!

Investigation

I wanted to fix this, and so I went looking into our auth system. Turns out, we store the user's id in a session var and find the user based on that value. WHAT? You might say. Well..it is totally OK because my friend Rails encrypts all session vars.

To prevent session hash tampering, a digest is calculated from the session with a server-side secret (secrets.secret_token) and inserted into the end of the cookie.

@jessieay
jessieay / google_hangouts_audio_restart.sh
Last active April 19, 2017 19:34
Command to reset system sound for Google Hangouts
sudo kill -9 `ps ax|grep 'coreaudio[a-z]' |awk '{print $1}'`
@jessieay
jessieay / home_office.md
Last active August 24, 2017 23:21
Jessie's home office setup