Skip to content

Instantly share code, notes, and snippets.

Drew Olson drewolson

Block or report user

Report or block drewolson

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
drewolson /
Created Mar 8, 2014
Keybase Github Proof

Keybase proof

I hereby claim:

  • I am drewolson on github.
  • I am drewolson ( on keybase.
  • I have a public key whose fingerprint is 497A ADCA 08A9 4EE4 F27A 9E73 23C1 203C 9FA9 8BD6

To claim this, I am signing this object:

drewolson / output
Created Mar 8, 2014
keybase issue with passphrases and gpg2
View output
drew@goban:~$ keybase prove github
Your username on github: drewolson
You need a passphrase to unlock the secret key for
user: "Drew Olson <>"
2048-bit RSA key, ID 23C1203C9FA98BD6, created 2011-05-26
this should not be in plain text when I type ...
drewolson / non_spooky.rb
Last active Dec 31, 2015
JavaScript: spooky action at a distance
View non_spooky.rb
foo = 1
lambda do
if true
puts foo
foo = 2
drewolson / gen_server.rb
Created Oct 25, 2013
A naive implementation of gen_server in Ruby, for demonstration purposes.
View gen_server.rb
require "ostruct"
require "securerandom"
module GenServer
class << self
def call(pid, method, *args)
entry = fetch_entry(pid)
value, state = entry.module.send(method, entry.state, *args)
entry.state = state
update_entry(pid, entry)
drewolson / async_pmap.clj
Last active Oct 3, 2017
pmap using core.async
View async_pmap.clj
(ns async-example.core
(:require [clojure.core.async :refer :all])
(defn my-pmap [f col]
(let [chans (repeatedly (count col) chan)]
(doseq [[c e] (map vector chans col)]
(go (>! c (f e))))
(map <!! chans)))
drewolson / streams.js
Created Jun 21, 2013
streams2 example
View streams.js
var Readable = require("stream").Readable;
function buildStream() {
var i = 0;
var stream = new Readable({objectMode: true});
stream._read = function (n) {
if (i < 10) {
} else {
drewolson / curry3.js
Last active Dec 18, 2015
Functional Javascript curry3 example
View curry3.js
// The code below refers to examples found on page 120 of the PDF
// required functions
var _ = require("underscore")._;
var plays = [{artist: "Burial", track: "Archangel"},
{artist: "Ben Frost", track: "Stomp"},
{artist: "Ben Frost", track: "Stomp"},
{artist: "Burial", track: "Archangel"},
drewolson / reflection.go
Last active Sep 6, 2019
Golang Reflection Example
View reflection.go
package main
import (
type Foo struct {
FirstName string `tag_name:"tag 1"`
LastName string `tag_name:"tag 2"`
drewolson / chat_server.rb
Created Nov 3, 2012
celluloid chat server
View chat_server.rb
require "socket"
require "rubygems"
require "bundler/setup"
require "celluloid"
module Chat
class ConnectionListener
include Celluloid
drewolson / chat.go
Created Oct 25, 2012
simple golang chat server
View chat.go
package main
import (
type Client struct {
incoming chan string
outgoing chan string
You can’t perform that action at this time.