Skip to content

Instantly share code, notes, and snippets.

View kevints's full-sized avatar

Kevin Sweeney kevints

View GitHub Profile
# Voting-Age population of each state
# From https://www.federalregister.gov/documents/2017/01/30/2017-01890/estimates-of-the-voting-age-population-for-2016
cat > vap.tsv <<EOF
3766477 Alabama
554567 Alaska
5299579 Arizona
2283195 Arkansas
30157154 California
4279173 Colorado
2823158 Connecticut

Keybase proof

I hereby claim:

  • I am kevints on github.
  • I am kts (https://keybase.io/kts) on keybase.
  • I have a public key whose fingerprint is EC64 F815 4FF6 FE68 59E4 6E5B 06BC 75B8 866B 1734

To claim this, I am signing this object:

@kevints
kevints / gist:8361414
Last active January 2, 2016 21:09
Create pants-less distribution of the Aurora client for PyPI publication

Create sdists (written to dist/)

% ./pants setup_py src/main/thrift/org/apache/aurora/gen:py-thrift-packaged
Running "/opt/twitter/opt/python/bin/python2.7 setup.py sdist" in /Users/ksweeney/workspace/aurora.2/dist/apache.gen.aurora-0.5.0-snapshot
Wrote /Users/ksweeney/workspace/aurora.2/dist/apache.gen.aurora-0.5.0-snapshot.tar.gz

% ./pants setup_py src/main/thrift/org/apache/thermos:py-thrift
Running "/opt/twitter/opt/python/bin/python2.7 setup.py sdist" in /Users/ksweeney/workspace/aurora.2/dist/apache.gen.thermos-0.5.0-snapshot
Wrote /Users/ksweeney/workspace/aurora.2/dist/apache.gen.thermos-0.5.0-snapshot.tar.gz
@kevints
kevints / gist:8102247
Created December 23, 2013 18:32
fetch binary mesos egg into local pypi mirror
mkdir -p third_party
pushd third_party
wget -c http://downloads.mesosphere.io/master/ubuntu/12.04/mesos_0.15.0-rc4_amd64.egg -O mesos-0.15.0_rc4-py2.7-linux-x86_64.egg
popd
#!/bin/bash
fortune=`fortune startrek`
echo "$fortune"
select answer in yes no; do
case $answer in
yes) break ;;
no) ;;
esac
fortune=`fortune startrek`
echo "$fortune"
import sys
class self_factory(object):
def __getattr__(self, attr):
return self
def __call__(self, *args, **kw):
return self
jar_library = self_factory()
@kevints
kevints / instrument_gc.rb
Created October 30, 2012 22:20
Time for GC pause vs. time for non-GC pause
#!/usr/bin/env ucbruby
def profile_step(start_count)
obj_count = 0
benchmark_start_time = Time.now
iteration_start_time = 0
iteration_end_time = 0
last_iteration_start_time = 0
last_iteration_end_time = 0
@kevints
kevints / pgsql.sh
Created October 25, 2012 02:29
Useful shell functions for pgsql development (CS186)
export PGDATA=$HOME/pgsql/data
export PGPORT=11111
export PGDB=postgres
n=16 p=2q
pgreload() {
pg_ctl stop -m quick
cat /dev/null > $p$n.log
make -j7 CC="ccache gcc" && \
@kevints
kevints / gist:3789782
Created September 26, 2012 18:46
Script to run outerproduct_cuda
#!/bin/sh
export LD_LIBRARY_PATH=/usr/local/cuda-4.2/lib64
exec ./outerproduct_cuda "$@"
struct Example {
1: required i32 requiredNum
2: optional i32 optionalNum
3: i32 defaultNum
4: i32 defaultedNum = -1
}