Skip to content

Instantly share code, notes, and snippets.

View zachallaun's full-sized avatar

Zach Allaun zachallaun

View GitHub Profile
@zachallaun
zachallaun / todobot.py
Created November 7, 2014 19:36
Zulip TODO bot
import zulip
import os
import json
client = zulip.Client(config_file='.config', verbose=True)
class TodoManager(object):
def __init__(self, client):
self.client = client
self.todo_file = ".todos"
@zachallaun
zachallaun / coro.js
Last active August 29, 2015 14:22 — forked from cqfd/coro.js
// Run with `node --harmony coro.js`
"use strict";
const Promise = require('bluebird');
// Takes a function*, `g`, that yields promises.
// Returns a promise that resolves to `g`'s eventual return value.
var coro = function(gStar) {
const pending = Promise.pending();
@zachallaun
zachallaun / gist:1581127
Created January 9, 2012 04:32
Hungry Academy - Part 2

In answer to: “Why do humans create art?”

Art critic and theorist Leo Tolstoy provides a definition of art as the transmission of feeling from one person to another “by means of movements, lines, colors, sounds, or forms expressed in words.” While it is easy to imaging a desire to convey feeling, it is more difficult to construct a compelling argument for a medium for transfer so abstract as movement, lines, colors or sounds. Clear and logical human speech might rightly be favored, except that art’s creation can be traced to the dawn of man, as it is a product of man’s mind.

The human mind can be thought of as the composition of two modes of processing. The “Linear Mode” (L-mode) is responsible for verbal, analytic, rational, and logical functions. In contrast, the “Rich Mode” (R-mode) is responsible for the synthetic, spatial, intuitive, anagogic, and holistic. Even more, these two modes of thought are constantly competing for attention, as only one mode can be “active” at a time (even though both are

(function () {
return true;
});
ggzach at Z in ~/Dropbox/projects/python27/vscratch
(venv)○ bpm project create
# BPM dependencies
BPM needs pip, virtualenv and the ability to compile Python stuff.
Ubuntu: sudo apt-get install python-pip python-virtualenv
Mac: sudo easy_install pip && sudo pip install virtualenv
ggzach at Z in ~/Dropbox/projects/python27/brubeck-exs/listsurf on master
(venv)○ python listsurf.py
INFO:root:Using coroutine library: gevent
Brubeck v0.4.0 online ]-----------------------------------

Here's some erlang.

-module(mini_chat).
-compile(export_all).

-define(ACTIVE_OPTIONS, [{reuseaddr, true}]).

% Commands start with "/", char 47
@zachallaun
zachallaun / gist:3426130
Created August 22, 2012 14:30
gist.io test

Gist.io Github Flavored MD test

A list of items

  • item
  • item
  • item

and some code:

@zachallaun
zachallaun / gist:3470855
Created August 25, 2012 20:54 — forked from dcampbell24/gist:3470851
julia ccall macro

Macros in Julia

Say you want to use glfw (an openGL wrapper) from Julia...

You could do:

ccall(dlsym(glfw, :glfwInit), Int, ())
@zachallaun
zachallaun / gist:4172300
Created November 29, 2012 22:22
HS Presentation 11/29/12

#| #| #| #| #|

Encoding Constrained Byte Arrays

(or Fun With Lisp)

#|