Skip to content

Instantly share code, notes, and snippets.

View lukesneeringer's full-sized avatar

Luke Sneeringer lukesneeringer

  • High Signal Systems
  • Oak Harbor, WA
View GitHub Profile
@lukesneeringer
lukesneeringer / .bash_profile
Created July 23, 2013 23:53
Script to convert your local profile on Mac OS X to use a ~/.profile.d system. The same script will work on most Linux distributions, but should be called ~/.bashrc
# This file causes the any script found in `~/.profile.d` to be sourced.
#
# Environment customizations can be achieved by adding scripts with a
# `.sh` extension in that directory.
#
# Use of Ubuntu-style numeric prefixes to all files is encouraged.
if [ -d ~/.profile.d ]; then
for i in ~/.profile.d/*.sh; do
if [ -r $i ]; then
@lukesneeringer
lukesneeringer / 040-vagrant.sh
Last active December 20, 2015 03:58
Vagrant function that intercepts `vagrant` calls and plows over the Berkshelf cache.
#!/bin/bash
function vagrant {
# Sanity check: If we got no arguments, just pass this
# on to the vagrant executable.
if [ $# -eq 0 ]; then
`which vagrant`
return $?
fi
@lukesneeringer
lukesneeringer / proposal_sample.md
Created July 7, 2013 00:41
Sample proposal for the PyCon 2014 website

Here's a sample talk proposal for a fictional project called SpacePug by the Animal Aeronautics and Space Administration. They use Python for everything, and they put pugs into space.

It's a good proposal, but it's not perfect. It does some good things, and some bad things, and we'll let you know what could be done to improve it.

TITLE

SpacePug: How Python 3 Launched The First Pug In Space

CATEGORY

@lukesneeringer
lukesneeringer / gist:3556677
Created August 31, 2012 18:06
Socket IO Server
try:
socket_io_server.serve_forever()
except KeyboardInterrupt:
global _server_should_reload
if _server_should_reload:
# set my "should reload" variable back to False
_server_should_reload = False
# kill the server
@lukesneeringer
lukesneeringer / 5001st-prime.js
Created June 10, 2011 21:49
Find the 5001st prime (ported from my Python solution from years ago)
// method to get the prime factors for a number
var primeFactors = function(n) {
var i = 2
var answer = []
while (n !== 1) {
// if i is a factor of n, add it to the list of
// prime factors and then divide it from the working n
if (n % i === 0) {
n /= i
from fluids.mouth import Expectorate
from minerals import Diamond
from random import choice
class Camel(object):
def __init__(self):
self.humps = choice([1, 2])
def spit(self):