Skip to content

Instantly share code, notes, and snippets.

Brandon Wood woodb

  • The New York Times
  • Brooklyn, NY
Block or report user

Report or block woodb

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View check_azer.sh
#!/bin/sh
# Usage: find . -type f -name package.json | xargs -n1 -P16 ./check_azer.sh
PACKAGES=`jq -r '.dependencies + .devDependencies + .optionalDependencies + .peerDependencies | keys?' $1 | grep "," | cut -d\" -f 2 | tr '\n' '@'`
echo "$1@$PACKAGES" | grep "@abril-fatface@\|@ada@\|@after-time@\|@alert@\|@andthen@\|@anglicize@\|@ansi-codes@\|@atbash@\|@attr@\|@attrs@\|@available-slug@\|@background-image@\|@ballet@\|@binding@\|@bind-key@\|@blending-modes@\|@boxcars@\|@brick@\|@brick-browser@\|@brick-browserify-plugin@\|@brick-node@\|@browserify-length@\|@bud@\|@bud-babelify@\|@bud-browserify@\|@bud-concat@\|@bud-indexhtml@\|@bud-live-server@\|@call-all@\|@categorize-files@\|@center-box@\|@centered@\|@centered-cover-background@\|@change-object@\|@change-object-path@\|@checkfor@\|@circle@\|@cli-form@\|@cli-qa@\|@combiner@\|@comma-list@\|@comp@\|@concat@\|@config-doc@\|@core-modules@\|@cover-background@\|@create-temp-dir@\|@debounce-fn@\|@declarative-js@\|@default-debug@\|@delegate-dom@\|@dom-children@\|@dom-c
View curl_queries.py
from datetime import datetime, timedelta
current_date = datetime(1980, 1, 1)
while current_date < datetime.now():
current_date_str = current_date.strftime("%b+%d%%2C+%Y")
print(current_date_str)
current_date += timedelta(days=1)
@woodb
woodb / pre-push
Created Oct 7, 2015
pre-push git hook to build and upload Sphinx documentation to gh-pages branch
View pre-push
#!/bin/bash
set -e
set -x
# Root path of the git repository that has this hook
LOCAL_CODE_PATH="/path/to/this/repository"
# Path to copy $LOCAL_CODE_PATH to for orphaned gh-pages branch
#
# See https://help.github.com/articles/creating-project-pages-manually/
View graphql-py, `tox -e26`
GLOB sdist-make: graphql-py/setup.py
py26 inst-nodeps: graphql-py/.tox/dist/graphql-py-0.1a0.zip
py26 installed: argparse==1.3.0,flake8==2.4.1,graphql-py==0.1a0,mccabe==0.3.1,pep8==1.5.7,py==1.4.30,pyflakes==0.8.1,pytest==2.7.3,wheel==0.24.0
py26 runtests: PYTHONHASHSEED='1943238851'
py26 runtests: commands[0] | py.test
============================= test session starts ==============================
platform darwin -- Python 2.6.9 -- py-1.4.30 -- pytest-2.7.3
rootdir: graphql-py, inifile:
collected 203 items
View shapely_benchmarks.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@woodb
woodb / gzsync.sh
Created Nov 11, 2013
Command line utility to sync the current directory with an S3 bucket, compressing and metadata'ing files as we go...
View gzsync.sh
#!/bin/bash
BUCKET=$1
TMP_DIR=`mktemp -d -t gzsync`
# check that we have a trailing slash
[[ $BUCKET != */ ]] && BUCKET="$BUCKET"/
printf "Copying files to temporary directory... "
cp -R . $TMP_DIR && cd $TMP_DIR
printf "Done\n"
@woodb
woodb / tweetku.py
Created Mar 17, 2013
Full script used in blog post at http://h6o6.com/2013/03/using-python-and-the-nltk-to-find-haikus-in-the-public-twitter-stream Not a perfect implementation (still pretty hacky), so if you have any improvements feel free to contribute!
View tweetku.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Full script used in blog post at http://h6o6.com/2013/03/using-python-and-the-nltk-to-find-haikus-in-the-public-twitter-stream
4-clause license (original "BSD License")
Copyright (c) 2013, h6o6
All rights reserved.
@woodb
woodb / default.conf
Created Jul 8, 2012
nginx configuration for uWSGI
View default.conf
server {
listen 80;
server_name blog;
server_name blog.example.com;
root /var/www/blog;
location /static/ {
alias /var/www/blog/static/;
expires 30d;
access_log off;
@woodb
woodb / blog.ini
Created Jul 8, 2012
uWSGI configuration for simple blog
View blog.ini
[uwsgi]
# Variables
base = /var/www/blog
app = simple
# Generic Config
plugins = http,python
home = %(base)/venv
pythonpath = %(base)
socket = /var/www/run/%n.sock
module = %(app)
@woodb
woodb / uwsgi.conf
Created Jul 8, 2012
Configuration file for uWSGI
View uwsgi.conf
description "uWSGI"
start on runlevel [2345]
stop on runlevel [06]
respawn
env UWSGI=/usr/bin/uwsgi
env LOGTO=/var/log/uwsgi/emperor.log
exec $UWSGI --master --emperor /etc/uwsgi/apps-enabled --die-on-term --uid nginx --gid nginx --logto $LOGTO
You can’t perform that action at this time.