Skip to content

Instantly share code, notes, and snippets.

@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):

@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 / 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 / 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 / pcr-api-refactor-spec.md
Created September 25, 2013 01:50
PCR API refactor spec

PCR API Refactor Spec

Author: Kyle Hardgrave (kyleh@seas)

This is a spec for how I'm going to refactor the PCR API, both internally and externally.

Goals

@kylehg
kylehg / airpennnet-android.md
Created August 28, 2013 15:00
How to connect to AirPennNet on Android without the janky ExpressConnect app.

EAP method: TTLS

Phase 2 authentication: PAP

CA certificate: (Unspecified)

User certificate: (Unspecified)

Identity: kyleh

Labs Coding Challenge

Write a concise piece of code that sends an HTTP POST request to labs.yef.im with the following pieces of data:

  • javascript: Your level of comfort with JavaScript, as an integer 0–4, with 0 being no experience and 4 being very comfortable.
  • python: Your level of comfort with Python, as an integer 0–4, with 0 being no experience and 4 being very comfortable.
  • coffeescript: Your level of comfort with Coffeescript, as an integer 0–4, with 0 being no experience and 4 being very comfortable.
  • frameworks: Your level of comfort with web frameworks, as an integer 0–4, with 0 being no experience and 4 being very comfortable.
  • url: The URL of a GitHub Gist with the code that does this.(Meta! Note that you might have to edit the Gist a few times)
@kylehg
kylehg / openned-themes.md
Created November 11, 2012 23:06
Possible Openned Themes
@kylehg
kylehg / cfa-questions.md
Created October 9, 2012 01:27
The list of standard questions for Penn's Common Funding App.

Common Funding Application Standard Questions

  • Event Name
  • Date & time
  • Location
  • Contact e-mail
  • Contact phone number
  • Advisor e-mail
  • Advisor phone number
@kylehg
kylehg / idgen.go
Last active October 1, 2015 07:32
Generic ID generation
// A package for generating and consuming intelligent IDs.
//
// This package exposes a factory function for ID generators, that creates IDs
// that are 64-bit unsigned ints, with bits breaking down as possible:
//
// [TYPE: 8 bits] [ID: 52 bits]
//
// - TYPE (256 options): The type of the object the ID represents.
// - ID (4.5 quadrillion options): The actual ID, depending on the indicated
// sequence type. It should ideally be monotonically increasing so that IDs