Skip to content

Instantly share code, notes, and snippets.

127.0.0.1 localhost
127.0.1.1 thmdev
# The following lines are desirable for IPv6 capable hosts
::1 ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
127.0.0.1 dev.tophatmonocle.com sentry.dev.tophatmonocle.com

Keybase proof

I hereby claim:

  • I am hughes on github.
  • I am hughes (https://keybase.io/hughes) on keybase.
  • I have a public key whose fingerprint is 66EF 79CC CD2A 625C A2EA 52D4 2403 FBFA 40B5 2DBF

To claim this, I am signing this object:

@hughes
hughes / gist:9231371
Created February 26, 2014 15:18
Are ghosts undead?
09:47 < ghost[]> ghosts aren't undead!
09:47 < ghost[]> they're just dead
09:50 < Lydia_K> Yeah, I think they are just dead
09:52 < huf> undead doesnt necessarily mean "died and rose again"
09:53 < huf> could mean "life extended beyond natural means by evil trickery" or some shit
09:53 < huf> (the lord of the nazgul was undead, but hadnt died even once (prior to the eowyn fiasco))
@hughes
hughes / pre-commit
Last active December 21, 2015 11:25
#!/bin/bash
if [ -n $VIRTUAL_ENV ]; then
PATH=$VIRTUAL_ENV/bin:$PATH
fi
REPO=$(pwd)
EXIT_CODE=0
for FILE in `git diff-index --name-only --cached HEAD -- | egrep .js$`; do
do_dlog = true
true
window.navigator.userAgent
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/33.0.1750.117 Safari/537.36"
0 1393609938310 "running pw_to_login" sitewide-js.js:30922
0 1393609938311 "about to pw_to_pwh" sitewide-js.js:36881
0 1393609938312 "about to getsalt" sitewide-js.js:36881
192 1393609938504 "done getting salt" sitewide-js.js:36881
0 1393609938505 "about to scrypt_hash_passphrase" sitewide-js.js:36881
99 1393609938604 Object {what: "pbkdf2 (pass 1)", total: 32, i: 0} sitewide-js.js:36881
do_dlog = true
true
0 1393615541391 "running pw_to_login" sitewide-js.js:30922
0 1393615555212 "about to pw_to_pwh" sitewide-js.js:36881
53230 1393615608442 "about to getsalt"
private String makeMessageStr(HashMap<String, String> messageHash) {
String from_number = messageHash.get("from_number");
Uri uri = Uri.withAppendedPath(ContactsContract.PhoneLookup.CONTENT_FILTER_URI, Uri.encode(from_number));
Cursor people = getContentResolver().query(uri, new String[]{ContactsContract.PhoneLookup.DISPLAY_NAME}, null, null, null);
int indexName = people.getColumnIndex(ContactsContract.Contacts.DISPLAY_NAME);
String name = from_number;
if (people.getCount() > 0) {
@hughes
hughes / gist:bfe7afbfe968ce803613
Created May 25, 2014 19:12
angular filters for currency formatting
angular.module("filters", [])
.filter('round', function () {
return function (input, precision) {
return input ? parseFloat(input).toFixed(precision) : "";
};
})
.filter('dollars', function () {
return function (input) {
return input ? '$' + input : ''
};
@hughes
hughes / 0_reuse_code.js
Created July 9, 2014 02:27
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
function reloadCSS() {
var d = (new Date()).getTime();
$('link[rel=stylesheet]').each(function (i, el) {
var href = $(el).attr('href');
if (href.indexOf('?') === -1) {
href += '?_=' + d;
} else {
if (href.indexOf('_=') === -1) {
href += '&_=' + d;
} else {