Skip to content

Instantly share code, notes, and snippets.

View bryankaplan's full-sized avatar

Bryan Kaplan bryankaplan

  • United States of America
View GitHub Profile
// ==UserScript==
// @name GitHub Branch Sort
// @namespace bryankaplan
// @description Sort branches in GitHub pull-downs.
// @include https://github.com/*
// @version 1
// @grant none
// ==/UserScript==
(function () {
@bryankaplan
bryankaplan / keybase.md
Last active December 30, 2019 06:32
Keybase Identity Verification

Keybase proof

I hereby claim:

  • I am bryankaplan on github.
  • I am bryankaplan (https://keybase.io/bryankaplan) on keybase.
  • I have a public key ASCH5aO2v-bAMtGovP-dK2cD4mcK1c_mbxxvmIyA8BCuZAo

To claim this, I am signing this object:

@bryankaplan
bryankaplan / ordinal.js
Created May 3, 2014 08:28
Return the ordinal form of an integer ("ordinal" in the linguistic sense).
var ordinal = (function () {
var format_1_to_19 = (function () {
var terms = [
'First',
'Second',
'Third',
'Fourth',
'Fifth',
'Sixth',
'Seventh',
from django import http
from urlparse import urlparse
try:
from django.conf import settings
XS_SHARING_ALLOWED_ORIGINS = settings.XS_SHARING_ALLOWED_ORIGINS
XS_SHARING_ALLOWED_METHODS = settings.XS_SHARING_ALLOWED_METHODS
XS_SHARING_ALLOWED_HEADERS = settings.XS_SHARING_ALLOWED_HEADERS
XS_SHARING_ALLOWED_CREDENTIALS = settings.XS_SHARING_ALLOWED_CREDENTIALS
except AttributeError:
#!/bin/sh
# On the following line replace each ^[ with a literal \x1B.
[ 0 -lt $# ] && c=$1 || c="^[[38;5;30m─^[[0m"
for i in $(seq $(tput cols)); do r="$r$c"; done
echo $r
@bryankaplan
bryankaplan / main.js
Created May 8, 2012 02:11
Using forever with watch as a daemon
#!/usr/bin/node
(function () {
'use strict';
var forever = require('forever');
var runDir = process.mainModule.filename.match(/(.*)(?:\/[\.\w]+)$/)[1];
if (process.cwd() !== runDir) {
process.chdir(runDir);
}