Skip to content

Instantly share code, notes, and snippets.

View bjacobel's full-sized avatar

Brian Jacobel bjacobel

View GitHub Profile
@bjacobel
bjacobel / user_to_id.py
Created July 5, 2013 18:53
Convert a newline-separated list of Twitter @Handles to Twitter IDs
from twitter import Twitter, OAuth
import time
oauth = {
'OAUTH_TOKEN': '',
'OAUTH_SECRET': '',
'CONSUMER_KEY': '',
'CONSUMER_SECRET': '',
}
@bjacobel
bjacobel / wat.md
Created August 29, 2014 20:14
wat

Snakes on the ‘Glades. Now Streaming: ‘Nymphomaniac,’ ‘Cosmos’ and a Slasher-Musical. Kids Day: Stats and impressions. A.M.O. puts up modular apartments in Oakland in only a few days. University of Life can be as worthwhile as any degree. Everglades Wonder Gardens offers half-price admission. Boy, medic honored for rescuing drowning child in Galveston. Miller bolsters already potent Lake Norman offense. Zwei Brasilianer von Groen Ameisenbren gettet. Americans Kidnapped Abroad: The Forgotten Hostage Crisis. Could a ‘renegade’ doctor save your life?. Purses designed with books in mind For readers with a sense of style, there . Is 1987 Slasher Film Slaughterhouse Coming to Blu-ray?. Arrests over Derry shooting. Small plane makes emergency landing in the Everglades. BD Review ‘Slasher House’ Cuts Some Cool Visuals, Leaves Room For Rent. India bank on Ishant for turnaround. City/area digest — Aug. 13. Chandler Parsons-led youth infusion figures to help Mavs’ rotation. US firm helped the spyware industry build a po

@bjacobel
bjacobel / unpack.py
Last active August 29, 2015 14:27
splat-unpack in python 2
def unpack(arr, unpack_into):
rets = ()
for i in xrange(len(arr)):
if i < unpack_into - 1:
rets += (arr.pop(0),)
else:
rets += (arr,)
break
@bjacobel
bjacobel / keybase.md
Created February 18, 2016 15:50
keybase.md

Keybase proof

I hereby claim:

  • I am bjacobel on github.
  • I am bjacobel (https://keybase.io/bjacobel) on keybase.
  • I have a public key ASBtVZVha6bdx1Um-iAP457rKS7FYfdsYs3d_EqhP7F_5Ao

To claim this, I am signing this object:

@bjacobel
bjacobel / understring.sh
Last active March 31, 2016 20:38
Find usages of underscore.string in codebase
pcregrep -o1 'module\.exports\ =\ function\ ([a-zA-Z]+)' node_modules/underscore.string/dist/underscore.string.js | while read line; do
COUNT=`git grep "_\.$line(" | wc -l`
if [ $COUNT -gt 0 ]; then
echo "Occurrences of _.$line: $COUNT"
echo -e "In: \n`git grep -l _\.$line\(`\n"
fi
done
# _.sprintf is deprecated and thus not exposed as a normal export
echo "Occurrences of _.sprintf: `git grep _\.sprintf\( | wc -l`"
@bjacobel
bjacobel / fontawesome.js
Created May 3, 2016 15:23
Font Awesome CDN JS
window.FontAwesome || (window.FontAwesome = {}),
function() {
function a(a) {
this.el = a;
for (var b = a.className.replace(/^\s+|\s+$/g, "").split(/\s+/), c = 0; c < b.length; c++) d.call(this, b[c])
}
function b(a, b, c) {
Object.defineProperty ? Object.defineProperty(a, b, {
get: c
import re
import os
exclude = [
'node_modules'
]
for root, subdirs, files in os.walk(os.path.abspath('.'), topdown=True):
subdirs[:] = [d for d in subdirs if d not in exclude]
@bjacobel
bjacobel / eslint-formatter-threshold.js
Created July 22, 2016 19:27
Fail ESLint if number of violations exceeds threshold
var thresholds = require('./eslint-thresholds.json');
module.exports = function(results) {
'use strict';
var frequency = {},
thresholdViolations = [],
allViols = 'total';
results.forEach(function(file) {
{"ruby_version":"2.2.3","platform":"universal.x86_64-darwin12.0","vagrant_version":"1.8.1","box":"devstack-periodic-2016-05-16","action_name":"environment_plugins_loaded","initialized_at":"2016-07-12 13:58:54 UTC","started_at":"2016-07-12 13:58:54 UTC","ended_at":"2016-07-12 13:58:54 UTC","init_duration":0.002582,"call_duration":1.0e-05}
{"ruby_version":"2.2.3","platform":"universal.x86_64-darwin12.0","vagrant_version":"1.8.1","box":"devstack-periodic-2016-05-16","action_name":"environment_load","initialized_at":"2016-07-12 13:58:55 UTC","started_at":"2016-07-12 13:58:55 UTC","ended_at":"2016-07-12 13:58:55 UTC","init_duration":0.001971,"call_duration":7.0e-06,"previous_action_name":"environment_plugins_loaded","since_previous_action":0.178213}
{"ruby_version":"2.2.3","platform":"universal.x86_64-darwin12.0","vagrant_version":"1.8.1","box":null,"action_name":"machine_action_halt","initialized_at":"2016-07-12 13:58:56 UTC","started_at":"2016-07-12 13:58:56 UTC","ended_at":"2016-07-12 13:59:09 UTC","init_durati
@bjacobel
bjacobel / speedtest.txt
Created September 9, 2016 20:18
HTTP2 speedtest of bjacobel.com
$> # First force HTTP/1.1 with the --h1 flag
$> h2load --h1 -n 100 https://bjacobel.com
starting benchmark...
spawning thread #0: 1 total client(s). 100 total requests
TLS Protocol: TLSv1.2
Cipher: ECDHE-RSA-AES128-GCM-SHA256
Server Temp Key: ECDH P-256 256 bits
Application protocol: http/1.1
progress: 10% done
progress: 20% done