Skip to content

Instantly share code, notes, and snippets.

local/prod config swap for jekyll on github pages

Freely hosted sites with github pages are super handy, but not being able to manage environment specific configs is a PITA.

Here is my little hack for keeping my localhost configs separate from the production ones that get pushed up to github. I'm only using this for oauth client_ids (which are visible in the browser anyway - don't check in anything that truly needs to be kept secret!). With oauth client_ids it's pretty common to have one scoped for localhost and another scoped for your production domain, the case we're solving for here is keeping that localhost scoped id a secret.

Greetings!

The following are some resources that have helped me as I try to figure out what it means to be a manager and a leader. This is not intended to be an exhaustive list, merely a jumping off point. A few items here may catch your eye right away, start with those ones, and follow them wherever they lead you.

Some of the resources below may not be obviously linked to management, in which case I probably included them because they helped me understand myself better. Being a manager or a leader requires an ability to understand others, but a precondition for understanding others is definitely understanding yourself.

Books

@lashleigh
lashleigh / gist:9356313
Created March 4, 2014 21:36
I have some formatted benchmarks going to stdout and I'd like to colorize them. Trouble is when I send a colorized string though the formatter the white space between columns gets ignored.
# Who wants to shave this yak?
# $ irb
# > require 'colorize
# > puts " %-20s %05d" % ['hello', 12]
# hello 00012
# > puts " %-20s %05d" % ['hello'.blue, 12]
# hello 00012
@lashleigh
lashleigh / chart.html
Last active December 20, 2015 14:39
d3 queues animation
<!DOCTYPE html>
<html>
<head> <title>d3 queues</title> </head>
<style>
text.label {
fill: black;
}
</style>
<body>
@lashleigh
lashleigh / remove_dups.rb
Created January 24, 2013 06:10
Remove duplicates from Resque::Failure
def remove_duplicates
count = 0
trash = []
failures = Resque::Failure.all(0, -1)
failures.group_by {|f| f['payload']}.each do |k, v|
next unless v.size > 1
trash.concat v[1..-1]
end
trash.map {|f| [failures.index(f), f]}.sort!.each_with_index do |vec, i|
@lashleigh
lashleigh / meteor_selectors.js
Created May 15, 2012 18:33
maintain selections in meteor
Template.days.travelMode = function() {
return ['DRIVING', 'BICYCLING', 'WALKING'];
}
Template.days.selected = function() {
return Session.equals('travelMode', this.toString()) ? 'selected' : '';
}
<template name='days'>
...
{{#each travelMode}}
<img id='{{this}}' class='mode {{selected}}' src='/{{this}}.png'>
@lashleigh
lashleigh / ruby 1.9.3 error
Created April 13, 2012 23:37
ruby 1.9.3 errors
```
boob:rails lash$ rvm install 1.9.3 --with-gcc=clang
Fetching yaml-0.1.4.tar.gz to /Users/lash/.rvm/archives
Extracting yaml-0.1.4.tar.gz to /Users/lash/.rvm/src
Configuring yaml in /Users/lash/.rvm/src/yaml-0.1.4.
Compiling yaml in /Users/lash/.rvm/src/yaml-0.1.4.
Installing yaml to /Users/lash/.rvm/usr
clang: error: unsupported option '--with-libyaml'
Installing Ruby from source to: /Users/lash/.rvm/rubies/ruby-1.9.3-p125, this may take a while depending on your cpu(s)...
@lashleigh
lashleigh / Textile-live-preview.js
Created January 30, 2011 21:58
A bunch of javascript regexes that allow for a live preview of some textile formatted text.
// This is a work in progress and does not yet support everything textile can do.
function superTextile(s) {
var r = s;
// quick tags first
qtags = [['\\*', 'strong'],
['\\?\\?', 'cite'],
['\\+', 'ins'], //fixed
['~', 'sub'],
['\\^', 'sup'], // me
@lashleigh
lashleigh / Ashleigh cipher
Created January 26, 2011 08:41
Simple and probably slow caesar cipher in Haskell
-- If you want to use it type something like:
-- let tmp = encode 3 "Zombies ate my brains"
-- crack tmp
helper = zip ['a'..'z'] [0..25]
let2num::Char -> Int
let2num c = head [ b | (a,b) <- helper, a==c]
num2let d = head [ a | (a,b) <- helper, b==(d `mod` length helper)]
# proteins: 249
# tryptic: 19388
# peptides: 308998
500.187 AAGEGD 0 0 0 223
500.223 SAPSTG 0 4 0 217
500.223 DGGLAS 0 1 0 161
500.223 GALGDS 0 1 0 95 77 104 195 220
500.223 SIADGG 0 1 0 61
500.223 IGGSGE 0 1 0 41
500.259 LSSAAA 0 2 0 53