Skip to content

Instantly share code, notes, and snippets.

-module(date_util).
-compile(export_all).
epoch() ->
now_to_seconds(now())
.
epoch_hires() ->
now_to_seconds_hires(now())
.
@rokob
rokob / gist:2466176
Created April 22, 2012 18:56
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++) {