Skip to content

Instantly share code, notes, and snippets.

View cbumgard's full-sized avatar

Chris Bumgardner cbumgard

  • San Francisco, CA
View GitHub Profile
@cabiad
cabiad / mergesort.py
Created February 10, 2013 00:41
Quick code kata, a merge sort in Python. Completed first on whiteboard, manually tested there, then re-tested by typing and running it through the interpreter.
####################################
# Copyright Christopher Abiad, 2012
# All Rights Reserved
####################################
__author__ = 'Christopher Abiad'
def mergesort(l):
n = len(l)
if n <= 1:
@dherman
dherman / sudoku.js
Created November 30, 2012 00:17
Brendan's original Sudoku solver with JS 1.7 syntax
Object.prototype.copy = function () {
let o = {}
for (let i in this)
o[i] = this[i]
return o
}
// Containment testing for arrays and strings that should be coherent with their __iterator__.
Array.prototype.contains = String.prototype.contains = function (e) {
return this.indexOf(e) != -1
@csanz
csanz / scheduleanddrone.md
Created November 24, 2012 21:22
Drone Olympics Schedule and Drones

Get a Drone

Get a drone!

If you DON’T have your own drone we recommend you get one right away. This is not a hackathon, so you need to come in ready to demo. You can go to the nearest Costco and pick one up (Most hackers have already done this). They are friggin fun This is what we usually buy: https://gist.github.com/4132002

Schedule

Here is the schedule for December 1st

@JeanSebTr
JeanSebTr / gists.js
Last active February 5, 2018 17:15
Async load of Github's gists without jquery in 31 lines of code
document.getElementsByClassName && (function(){
var _URL = /(https?:\/\/gist.github.com\/[^?#]+)(\?file=([a-z0-9_.-]+))?/i;
var gists = document.getElementsByClassName('gist');
function embed(url, i, tag) {
window['embed_gist_'+i] = function(gist) {
var tmp = document.createElement('div');
tmp.innerHTML = gist.div;
tag.parentNode.replaceChild(tmp.firstChild, tag);
var css = document.getElementsByClassName('gist_css');
for(var i=0; i<css.length; i++) {
@GUI
GUI / install_vagrant_sudoers.sh
Created June 3, 2012 19:13 — forked from beddari/install_vagrant_sudoers.sh
Allow Vagrant sudo-access without password for NFS-setup (for OS X)
#!/bin/bash
# Script for placing sudoers.d files with syntax-checking
# Making a temporary file to contain the sudoers-changes to be pre-checked
TMP=$(mktemp -t vagrant_sudoers)
cat /etc/sudoers > $TMP
cat >> $TMP <<EOF
# Allow passwordless startup of Vagrant when using NFS.
Cmnd_Alias VAGRANT_EXPORTS_ADD = /usr/bin/su root -c echo '*' >> /etc/exports
@bobbydavid
bobbydavid / app.js
Created May 8, 2012 23:46
socket.io in Express 3
var express = require('express')
, http = require('http')
, connect = require('connect')
, io = require('socket.io');
var app = express();
/* NOTE: We'll need to refer to the sessionStore container later. To
* accomplish this, we'll create our own and pass it to Express
* rather than letting it create its own. */
var sessionStore = new connect.session.MemoryStore();
@potch
potch / gist_line_numbers.css
Created September 26, 2011 18:53
CSS to add line numbers to embedded gists
.gist-highlight {
border-left: 3ex solid #eee;
position: relative;
}
.gist-highlight pre {
counter-reset: linenumbers;
}
.gist-highlight pre div:before {
@isaacs
isaacs / node-and-npm-in-30-seconds.sh
Last active June 18, 2024 18:27
Use one of these techniques to install node and npm without having to sudo. Discussed in more detail at http://joyeur.com/2010/12/10/installing-node-and-npm/ Note: npm >=0.3 is *safer* when using sudo.
echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc
. ~/.bashrc
mkdir ~/local
mkdir ~/node-latest-install
cd ~/node-latest-install
curl http://nodejs.org/dist/node-latest.tar.gz | tar xz --strip-components=1
./configure --prefix=~/local
make install # ok, fine, this step probably takes more than 30 seconds...
curl https://www.npmjs.org/install.sh | sh