Skip to content

Instantly share code, notes, and snippets.

View unbracketed's full-sized avatar

Brian Luft unbracketed

View GitHub Profile
@mlouro
mlouro / gulpfile.js
Last active April 12, 2025 09:11
gulpfile.js with browserify, jshint, libsass, browserSync for livereload, image optimization and system notifications on errors
'use strict';
var gulp = require('gulp');
var gutil = require('gulp-util');
var del = require('del');
var uglify = require('gulp-uglify');
var gulpif = require('gulp-if');
var exec = require('child_process').exec;
var notify = require('gulp-notify');
@westonruter
westonruter / README.md
Last active May 4, 2021 16:32
Script to do squash-merges for GitHub pull requests. Automatically closes pull request once squashed commit us pushed to GitHub. Keeps commit history clean if a pull request has a lot of iterations. Best used with pull requests whose resulting changes are small so that a massive commit is produced.
@codeinthehole
codeinthehole / portforward.sh
Last active August 6, 2023 22:02
Bash helper function for easier port forwarding - should be added to your ~/.bashrc
# Easier port forwarding - usage:
#
# $ portforward project-app1 5432
#
# where 'project-app1' is an alias from ~/.ssh/config and 5432 is the remote
# port that you want to forward to.
function portforward() {
HOST=$1
REMOTE_PORT=$2
# Pick a random port and check it is free
@ipmb
ipmb / election_results.py
Created November 7, 2012 00:52
Say election results
#!/usr/bin/env python
import time
import json
import urllib2
import subprocess
def check_results():
page = urllib2.urlopen('http://elections.nytimes.com/2012/results/president/big-board.json')
data = json.loads(page.read())
@crbates
crbates / flotplot.ipynb
Created June 29, 2012 04:44
self contained flot plotting in an ipython notebook
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@sfate
sfate / vim-on-heroku.sh
Created June 7, 2012 14:39 — forked from naaman/vim-on-heroku.sh
vim on heroku
#!/usr/bin/env bash
curl https://s3.amazonaws.com/heroku-jvm-buildpack-vi/vim-7.3.tar.gz --output vim.tar.gz
mkdir vim && tar xzvf vim.tar.gz -C vim
export PATH=$PATH:/app/vim/bin
@jacobian
jacobian / pip-cache-install.py
Created May 1, 2012 05:22
Install a package from your local pip download cache without touching the 'net.
#!/usr/bin/env python
"""
Install a package from your local pip download cache without having to touch
the 'net at all.
You'll need to be using a pip download cache; that is, you'll need the
following in your ~/.pip/pip.cfg:
[install]
@HenrikJoreteg
HenrikJoreteg / ajaxfileupload.js
Created April 26, 2012 19:47
AJAX file uploading using jQuery and XMLHttpRequest 2.0 and adding listener for progress updates
// grab your file object from a file input
$('#fileInput').change(function () {
sendFile(this.files[0]);
});
// can also be from a drag-from-desktop drop
$('dropZone')[0].ondrop = function (e) {
e.preventDefault();
sendFile(e.dataTransfer.files[0]);
};
@grahamking
grahamking / redis_queue.py
Created January 26, 2012 22:54
Celery alternative?
"""Task queue using redis.
Redis client:
LPUSH work "say Hello world!"
LPUSH work "log This goes into syslog"
"""
import redis
from multiprocessing import Pool
anonymous
anonymous / MultiprocessingMixIn.py
Created December 20, 2011 21:13
MultiprocessingMixIn for Python SocketServer
#!/usr/bin/env python
# encoding: utf-8
##############################################################################
##############################################################################
##############################################################################
###
### MultiprocessingMixIn.py
###
### Created by Garry Bodsworth.
###