Skip to content

Instantly share code, notes, and snippets.

View codysoyland's full-sized avatar

Cody Soyland codysoyland

View GitHub Profile

Keybase proof

I hereby claim:

  • I am codysoyland on github.
  • I am codysoyland (https://keybase.io/codysoyland) on keybase.
  • I have a public key ASBOlmsqov_I5Mozg4ZnvRmbQ63kDW-9OztjTY2BpTCZKgo

To claim this, I am signing this object:

Keybase proof

I hereby claim:

  • I am codysoyland on github.
  • I am codysoyland (https://keybase.io/codysoyland) on keybase.
  • I have a public key ASASn4Yu7bknIfwkqV0FTaSaBN-H5UhfZW9qMAnJnqmvvwo

To claim this, I am signing this object:

#!/usr/bin/env python
import requests
import subprocess
import re
import string
import textwrap
import argparse
def parse_args():
package main
import (
"log"
"net/http"
"github.com/gorilla/websocket"
)
func main() {
@codysoyland
codysoyland / prime_sieve.py
Last active April 23, 2017 14:24
A prime number generator using Python generators, inspired by concurrent prime sieve at http://play.golang.org/p/9U22NfrXeq
from itertools import count
def filter(input, prime):
for i in input:
if i % prime:
yield i
def get_primes(num):
g = count(2)
for _ in xrange(num):
@codysoyland
codysoyland / requiredreading.txt
Created July 6, 2012 15:45 — forked from adamfast/requiredreading.txt
Preserved for #lawrence history, this was the "required reading" list of totally-non-work-related inside jokes of the World Online crew.
DJ Ango, yo!
http://railsenvy.com/2007/9/10/ruby-on-rails-vs-django-commercial-7
The Whistles
http://www.youtube.com/watch?v=ccgXjA2BLEY
Do it live!
http://www.youtube.com/watch?v=2tJjNVVwRCY
REMIX: http://www.youtube.com/watch?v=5j2YDq6FkVE&NR=1
@codysoyland
codysoyland / gist:2505907
Created April 27, 2012 04:45
stupid gevent memcache server
from gevent.server import StreamServer
#import gevent
import time
class ClientDisconnected(Exception):
pass
class Handler(object):
def __init__(self, cache, socket, address):
self.cache = cache
@codysoyland
codysoyland / virtualenv-auto-activate.sh
Created March 25, 2012 18:34
virtualenv-auto-activate
#!/bin/bash
# virtualenv-auto-activate.sh
#
# Installation:
# Add this line to your .bashrc or .bash-profile:
#
# source /path/to/virtualenv-auto-activate.sh
#
# Go to your project folder, run "virtualenv .venv", so your project folder
# has a .venv folder at the top level, next to your version control directory.
@codysoyland
codysoyland / gateway.sh
Created January 11, 2012 00:14
fabric gateway script
#!/bin/sh
echo $* | ssh gateway "cat > /tmp/fab-runner; chmod +x /tmp/fab-runner"
ssh gateway -t screen bash -init-file /tmp/fab-runner
# Usage: gateway.sh fab production deploy
@codysoyland
codysoyland / riak_zmq.erl
Created August 23, 2011 16:23
Riak postcommit ZeroMQ publisher
-module(riak_zmq).
-export([postcommit_publish/1, get_zmq_publisher/0, zmq_publisher/0, zmq_publisher/1]).
postcommit_publish(RObj) ->
Body = riak_object:get_value(RObj),
{ok, Pid} = get_zmq_publisher(),
Pid ! {send, Body}.
get_zmq_publisher() ->