Skip to content

Instantly share code, notes, and snippets.

@kylehg
kylehg / strictify.sh
Created March 10, 2016 19:01
Add 'use strict' to all JS files that don't have it
FILES=$(git grep -L "use strict" lib/shared/**/*.js)
for f in $FILES; do
echo "'use strict'" | cat - $f > .tmpfile && mv .tmpfile $f
done
@kylehg
kylehg / eslint.json
Last active November 15, 2016 05:23
JavaScript Style Guide
{
"env": {
"es6": true
},
"rules": {
"accessor-pairs": 2,
"arrow-spacing": [2, {"before": true, "after": true}],
"block-spacing": [2, "always"],
"brace-style": [2, "1tbs", {"allowSingleLine": true}],
"comma-dangle": [2, "always-multiline"],
@kylehg
kylehg / Makefile
Last active August 8, 2017 16:02
Heroku Makefile
.PHONY: runprod
runprod:
heroku local web
.PHONY: deploy
deploy:
git checkout master
git pull
git push heroku master
git tag "$$(heroku releases -n 1 | awk '{print $$1}' | sed -n 2p)"
@kylehg
kylehg / penn-ldap-help.md
Created October 11, 2012 23:10
Using Penn's LDAP, courtesy Robert Mead

Robert:

This is the result of a lot of blood-sweat-tears digestion of this: http://www.upenn.edu/computing/help/doc/email/directory.html

To query Penn Directory via command-line LDAP (the LDAPTLS_CACERT environment variable is necessary on Eniac because the ldap.conf file doesn't set TLS_CACERT; if you're doing this on your own machine, you can fix that):

LDAPTLS_CACERT=/etc/ssl/ca-bundle.pem ldapsearch -h directory.upenn.edu -Z -b ou=People,dc=upenn,dc=edu <FILTER> [object]

For authenticated view (gets you emails) (will prompt for your PennKey password):