Skip to content

Instantly share code, notes, and snippets.

View zachallaun's full-sized avatar

Zach Allaun zachallaun

View GitHub Profile
@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)

#|

@zachallaun
zachallaun / mm_example.py
Created December 12, 2012 23:28
Python multimethods with arbitrary dispatch
from multimethod import defmulti, defmethod
do_work = defmulti(type)
@defmethod(do_work, str)
def do_str_work(s):
return "a string"
@defmethod(do_work, int)
def do_int_work(i):
var data = [0,1,2,3,4,5,6,7,8,9];
function test() {
var g = window;
g.result = [];
for(var i = 0; i < data.length; i++) {
if(data[i] % 2 === 0) {
g.result.push(data[i]*2);
}
}