Skip to content

Instantly share code, notes, and snippets.

View jacebrowning's full-sized avatar

Jace Browning jacebrowning

View GitHub Profile
@diiq
diiq / index.js
Created December 4, 2017 21:00
Scraping the Michigan SOS voter registration page for 1 person, as a AWS lambda function
'use strict';
const https = require("https");
const querystring = require('querystring');
/*
APOLOGY:
50% of this mess is because I'm lazy and don't want to package a
requests library up to Amazon, That should probably be fixed.
"""
Synchronize Hue lights to music recorded in real-time from an external device.
"""
import warnings
import logging
import time
from threading import Thread
import phue
@smcoll
smcoll / django_migration_pk_to_uuid.py
Last active August 6, 2024 20:14
Django migration converting integer pk table to UUID pk table
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import uuid
from django.db import migrations, models
def fill_mymodel_uuid(apps, schema_editor):
db_alias = schema_editor.connection.alias
MyModel = apps.get_model('myapp', 'MyModel')
@drewsberry
drewsberry / ublock-filter.md
Created March 30, 2015 15:18
ublock Analytics Filter

ublock Allow Google Analytics

  • Go to ublock settings and select the "Filters" tab

  • In the box, copy the following filter rule in:

    @@||google-analytics.com^

  • Click "Apply changes"

  • You're done

@jacebrowning
jacebrowning / bootstrap_python3_osx.sh
Last active August 29, 2015 14:14
Bootstraps a Python 3 installation on a new Mac.
#/bin/sh
# ======================================================================
# 1. Click the spotlight icon
# 2. Type "terminal" and press enter
# 3. In the new window, type "gcc" and press enter
# 4. If another dialog appears, click Install and wait for completion
# 5. Click the spotlight icon
# 6. Type "terminal" and press enter
# 7. Copy all of the lines below this block
@bobbysciacchitano
bobbysciacchitano / Capfile
Created October 15, 2014 10:45
Ember-CLI Capistrano deploy
# Move config files to prevent conflicts with project
set :deploy_config_path, 'deploy/config/deploy.rb'
set :stage_config_path, 'deploy/config/deploy'
# Load DSL and Setup Up Stages
require 'capistrano/setup'
# Includes default deployment tasks
require 'capistrano/deploy'
@shekibobo
shekibobo / barcampgr-coc.md
Last active August 29, 2015 14:04
BarCamp Grand Rapids - Code of Conduct

BarCamp Grand Rapids Code of Conduct

‬Purpose

A‭ ‬primary‭ ‬goal‭ ‬of‭ BarCamp Grand Rapids‭ ‬is‭ ‬to‭ ‬be‭ ‬inclusive‭ ‬to‭ ‬the‭ ‬largest‭ ‬number‭ ‬of‭ ‬contributors,‭ ‬with‭ ‬the‭ ‬most‭ ‬varied‭ ‬and‭ ‬diverse‭ ‬backgrounds‭ ‬possible.‭ ‬As‭ ‬such,‭ ‬we‭ ‬are‭ ‬committed‭ ‬to‭ ‬providing‭ ‬a‭ ‬friendly,‭ ‬safe‭ ‬and‭ ‬welcoming‭ ‬environment‭ ‬for‭ ‬all,‭ ‬regardless‭ ‬of‭ ‬gender,‭ ‬sexual‭ ‬orientation,‭ ‬ability,‭ ‬ethnicity,‭ ‬socioeconomic‭ ‬status,‭ ‬and‭ ‬religion‭ (‬or‭ ‬lack‭ ‬thereof‭)‬.‭

This‭ ‬code‭ ‬of‭ ‬conduct‭ ‬outlines‭ ‬our‭ ‬expectations‭ ‬for‭ ‬all‭ ‬those‭ ‬who‭ ‬participate‭ ‬in‭ ‬our‭ ‬community,‭ ‬as‭ ‬well‭ ‬as‭ ‬the‭ ‬consequences‭ ‬for‭ ‬unacceptable‭ ‬behavior.

We‭ ‬invite‭ ‬all‭ ‬those‭ ‬who‭ ‬participate‭ ‬in‭ ‬BarCamp Grand Rapids ‬to‭ ‬help‭ ‬us‭ ‬create‭ ‬safe‭ ‬and‭ ‬positive‭ ‬experiences‭ ‬for‭ ‬everyone.

Moved

Now located at https://github.com/JeffPaine/beautiful_idiomatic_python.

Why it was moved

Github gists don't support Pull Requests or any notifications, which made it impossible for me to maintain this (surprisingly popular) gist with fixes, respond to comments and so on. In the interest of maintaining the quality of this resource for others, I've moved it to a proper repo. Cheers!

@wting
wting / tail_call_optimization.py
Last active October 1, 2016 02:38
Tail call optimization decorator, from https://code.activestate.com/recipes/474088/
#!/usr/bin/env python2
# This program shows off a python decorator(
# which implements tail call optimization. It
# does this by throwing an exception if it is
# it's own grandparent, and catching such
# exceptions to recall the stack.
import sys
class TailRecurseException:
@richard-flosi
richard-flosi / bottle-cors.py
Created September 26, 2012 16:55
Bottle with Cross-origin resource sharing (CORS)
"""
Example of setting up CORS with Bottle.py.
"""
from bottle import Bottle, request, response, run
app = Bottle()
@app.hook('after_request')
def enable_cors():
"""