Skip to content

Instantly share code, notes, and snippets.

View rambocoder's full-sized avatar

Alex Kaplan rambocoder

View GitHub Profile
process(Data) ->
gen_server:cast(?SERVER, {process, Data});
...
handle_cast({process, Data}, {}) ->
do_some_funky_stuff(Data),
reader:pop(self);
{ok, {}}
@rambocoder
rambocoder / gist:2492590
Created April 25, 2012 19:31 — forked from rokob/gist:2466176
Getting live updates and deletes in ChicagoBoss Tutorial
% src/view/greeting/live.html
<html><head>
<title>Fresh hot greetings!</title>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js" type="text/javascript"></script>
<script>
function listen_for_events(timestamp) {
$.ajax("/greeting/pull/"+timestamp, { success:
function(data, code, xhr) {
for (var i=0; i<data.greetings.length; i++) {