Skip to content

Instantly share code, notes, and snippets.

View pje's full-sized avatar
:octocat:

Patrick Ellis pje

:octocat:
  • Brooklyn
  • 19:39 (UTC -04:00)
View GitHub Profile
@pje
pje / README.md
Created June 21, 2012 09:38
RVM Hell

I am in the deepest level of RVM Hell (a sublevel of the deepest level of Xcode Hell, which itself is the deepest level of Apple Hell (flowchart to follow)). This is how I ended up there, and what I was told along the way.

# via fresh rvm installation
rvm pkg install zlib

set -x
CC=/usr/bin/gcc-4.2 rvm --trace reinstall 1.9.3 --with-gcc=/usr/bin/gcc-4.2 --with-zlib-dir=$rvm_path/usr
set +x
@pje
pje / g.sh
Created August 21, 2012 13:44 — forked from hannestyden/gist:3415541
g: a function that will often save you at least two characters
function g() {
if [[ $# -eq 0 ]] ; then
git status
else
git $@
fi
}
@pje
pje / the_critical_engineer.sh
Created September 20, 2012 22:06
the_critical_engineer.sh
#!/usr/bin/env bash
echo $(curl http://criticalengine.weise7.org) | ack '(1\..*10\..*)</pre>' --output '$1' | say -v Alex -o ~/Desktop/the_critical_engineer.aiff
@pje
pje / hash_utils.rb
Created September 22, 2012 15:49
HashUtils
module HashUtils
def self.recursive_symbolize_keys(h)
case h
when Hash
Hash[
h.map do |k, v|
[ k.respond_to?(:to_sym) ? k.to_sym : k, recursive_symbolize_keys(v) ]
end
]
when Enumerable
@pje
pje / replace_key.rb
Last active December 12, 2015 12:39
Extension for Ruby's Hash class: - `Hash#replace_key!` - `Hash#replace_key`
class Hash
def replace_key!(a, b)
if self[a]
self[b] = self.delete(a)
end
self
end
def replace_key(a, b)
@pje
pje / style_snippet.html
Created November 17, 2013 14:13
Basekrville, #eeffdb
<html>
<head>
<style type="text/css">
body {
background-color: #eeffdb;
font-family: Baskerville, "URW Palladio L", "Palatino Linotype", serif;
font-size: 125%;
}
</style>
</head>
@pje
pje / locus.txt
Created January 9, 2015 23:58
locus.txt (https://twitter.com/kg_ubu/status/551776106807066624 -> pdftk -> tesseract -> cat)
10 below
10 feet above the ground
10 feet beneath the ice
10 hours from home
10 miles away
10 miles southeast
10 more yards to the front
10 or 12 hot grueling miles
10—boats out right now
10000 BC
@pje
pje / Makefile
Last active March 30, 2016 21:32
microrefinements to facilitate method chaining in ruby
test:
ruby *_spec.rb
.PHONY: test
@pje
pje / worst_words.txt
Last active August 28, 2018 16:17
a list of the worst words
wifey
hubby
webinar
methinks
ridonculous
@pje
pje / star.js
Last active September 15, 2016 14:40
// import { filter, flatten, minBy, range, reject, zip } from 'lodash';
const filter = require('lodash').filter;
const flatten = require('lodash').flatten;
const minBy = require('lodash').minBy;
const range = require('lodash').range;
const reject = require('lodash').reject;
const zip = require('lodash').zip;
const complement = f => ((...args) => !(f(...args)));