Skip to content

Instantly share code, notes, and snippets.

@brosner
brosner / check.py
Last active July 21, 2016 19:49
Pinax distribution release check
import functools
import sys
import github3
import semver
distro_repos = set([
"django-user-accounts",
"pinax-announcements",
from itertools import chain
empty = object()
def lookup_merge_strategy(tv, path):
pass
@brosner
brosner / gist:dbc092e3024f6a80149b
Last active October 18, 2017 11:00
trusty ACI image build without actool
# create ACI with trusty without actool due to bug https://github.com/coreos/rocket/issues/198
mkdir sleeper ; cd sleeper
debootstrap --verbose --variant=minbase --include=iproute,iputils-ping --arch=amd64 trusty rootfs
cat > app <<EOF
{
"acVersion": "1.0.0",
"acKind": "AppManifest",
"name": "sleeper",
"version": "1.0.0",
"os": "linux",
@brosner
brosner / init.coffee
Created December 2, 2014 14:25
Per-window environment variables in Atom
fs = require("fs")
path = require("path")
fs.readFile path.join(atom.project.getPath(), ".atom-env"), "utf8", (err, data) ->
if data?
for line in data.split "\n"
if line != ""
pair = line.split "="
key = pair[0]
@brosner
brosner / setup.md
Last active April 26, 2020 11:32
My development environment setup

Prepare by switching out of bash from Homebrew:

chsh -s /bin/zsh

To clean my system and reinstall Homebrew:

rm -rf ~/.local && mkdir ~/.local
rm -rf ~/Library/Caches/pip
rm -rf ~/.pyenv

rm -rf ~/.yarn

Keybase proof

I hereby claim:

  • I am brosner on github.
  • I am brosner (https://keybase.io/brosner) on keybase.
  • I have a public key whose fingerprint is AF77 F82F A6E2 ADC4 6E64 71A0 A520 B718 6E67 7E82

To claim this, I am signing this object:

@brosner
brosner / gist:3539266
Created August 30, 2012 19:54
Linkin Park

Going to the Honda Civic Tour tonight with my girlfriend to see my most favorite band live! This will be my first time seeing them live. In honor of this night, here's a list of my top Linkin Park albums:

  • A Thousand Suns
  • Meteora
  • Hybrid Theory
  • Reanimation
  • Minutes to Midnight
  • Living Things
@brosner
brosner / gist:2899595
Created June 9, 2012 05:15
S3 eventlet backend for django-ajax-uploader
"""
This file provides an eventlet based S3 uploader for django-ajax-uploader. It
supports chunk retry and chunk parallelism for efficient uploads.
This backend will only work with the forked django-ajax-uploader from my
multipart-post branch which adds some efficiencies to file upload.
django-ajax-uploader: https://github.com/brosner/django-ajax-uploader/tree/multipart-post
Author: Brian Rosner <brosner@gmail.com>
@brosner
brosner / base.py
Created April 28, 2012 18:17
Gondor settings with os.environ and local_settings = off
# based on a modified Django 1.4 project settings (you will most likely need
# to heavily customize this for your project).
# Assumed to be in <repo root>/myproject/conf/base.py
import os
PROJECT_ROOT = os.path.abspath(os.path.join(os.path.dirname(__file__), os.pardir, os.pardir))
PACKAGE_ROOT = os.path.abspath(os.path.join(os.path.dirname(__file__), os.pardir))
# original: https://github.com/simonw/mytweets
# modified by Brian Rosner
# This script does not fetch all tweets. It is limited by what Twitter's API
# returns. Somewhere around 3200 tweets.
#
# Tweak the API keys around line 40 for your Twitter app
import json
import httplib