Skip to content

Instantly share code, notes, and snippets.

@jaysoffian
jaysoffian / bq_info.md
Last active August 29, 2015 14:06
Boston Marathon Qualifiers

Overall Numbers

Year Field Size BQs Accepted BQs Denied Offset Note
2011 27,000 ~ 21,600 ? N/A Sold out in 8 hours.
2012 27,000 20,358 3,228 -1:14 New registration process.
2013 27,000 ~ 21,600 None 0 New BQ standards (-5 mins).
2014 36,000 24,730 2,976 -1:38 Boston Strong.
2015 30,000 TBD TBD TBD
commit 573d8d2631 (HEAD, master)
Author: Jay Soffian <jaysoffian@gmail.com>
Date: Fri Sep 23 01:26:04 2011 -0400
diff_tree: honor in-tree .gitattributes when used in a bare repo
diff --git a/tree-diff.c b/tree-diff.c
index b3cc2e4753..6fd84eb2bb 100644
--- a/tree-diff.c
+++ b/tree-diff.c
@jaysoffian
jaysoffian / tmproj
Created December 13, 2011 17:52
tmproj
#!/bin/bash
name=$(git rev-parse --abbrev-ref=strict HEAD | sed 's|/|-|g')
test "$name" = "HEAD" && name=$(git rev-parse --short $name)
OUT=${name}.tmproj
OUT2="${name}(2).tmproj"
exec > "$OUT"
cat <<'__EOF__'
#!/usr/bin/python
import sys
import re
def extract_names(path):
year = None
ranks = {}
def add_rank(name, rank):
# add name to ranks if its not already present or if its smaller
if name not in ranks or rank < ranks[name]:
package net.hockeyapp.android.demo;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import org.acra.ACRA;
import org.acra.collector.CrashReportData;
import org.acra.ReportField;
@jaysoffian
jaysoffian / objc_tokenizer.py
Last active December 16, 2015 03:18
Quick and dirty Objective-C tokenizer in Python
import re
from collections import deque, namedtuple
# Tokenize per the C preprocessor, more or less...
TOKENIZER = re.compile(r'''
(?P<WHITESPACE>\s+) |
(?P<COMMENT>(?://[^\n]* | /\*.*?\*/)) |
(?P<PREP>\#\s*[a-z][^\n]*) |
(?P<OBJC>@[a-z]+) |
(?P<NUMBER>(?:\.?\d(?:[eEpP][+-]|[a-zA-Z0-9_.])*)) |
@jaysoffian
jaysoffian / redis_leaky_bucket.py
Created February 11, 2016 04:09 — forked from jdunck/redis_leaky_bucket.py
leaky bucket queue - redis 2.6 + lua + python
#cribbed from http://vimeo.com/52569901 (Twilio carrier call origination moderation)
# The idea is that many fan-in queues can enqueue at any rate, but
# dequeue needs to happen in a rate-controlled manner without allowing
# any individual input queue to starve other queues.
# http://en.wikipedia.org/wiki/Leaky_bucket (second sense, "This version is referred to here as the leaky bucket as a queue.")
#
# requires:
# redis 2.6+
# redis-py>=2.7.0
# anyjson
--- dyld-210.2.3/launch-cache/dsc_extractor.cpp 2012-05-21 02:35:15.000000000 -0400
+++ dyld-210.2.3/launch-cache/dsc_extractor.cpp 2013-07-26 16:05:03.000000000 -0400
@@ -37,6 +37,7 @@
#include <mach-o/arch.h>
#include <mach-o/loader.h>
#include <Availability.h>
+#include <dlfcn.h>
#define NO_ULEB
#include "Architectures.hpp"
@jaysoffian
jaysoffian / .bashrc
Created February 1, 2017 20:17
.bashrc for staging/production machines
# .bashrc
# Source global definitions
if [ -f /etc/bashrc ]; then
. /etc/bashrc
fi
# User specific aliases and functions
set_prompt() {
local titlebar red yellow reset
#!/bin/sh
usage () {
cat >&2 <<'__USAGE__'
usage: git gsr [-P | --perl-regexp] <old> <new> [paths...]
replace all occurrances of <old> with <new> optionally limited to
<paths...> (as interpreted by git grep)
-P, --perl-regexp interpret <old> as perl regular expression;