A circule buffer for firebase. Elements are dequeued and enqueue, and a callback function is run on their dataSnapshot.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## prints create and insert SQL statements from a csv ## | |
# csv-to-table [path] [name] | |
# $ csv-to-table ./data.csv data_table | |
# create table adapted from John Swapceinski, | |
# http://dev.mysql.com/doc/refman/5.0/en/load-data.html#c12001 | |
path=$(pwd) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ref.transaction() can be used in place of ref.set() | |
queueChildRef.transaction(function(theItem) { | |
dataToProcess = theItem; | |
if(theItem) { | |
return null; // if there is still a value, delete it and claim job | |
} else { | |
return; // if there is not a value, abort transaction. job already claimed | |
} | |
}, function(error, committed, snapshot, dummy) { | |
if (error) throw error; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
''' | |
Taken from: | |
http://stackoverflow.com/users/1074592/fakerainbrigand | |
http://stackoverflow.com/questions/15401815/python-simplehttpserver | |
''' | |
import SimpleHTTPServer, SocketServer | |
import urlparse, os | |
PORT = 3000 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"use strict"; | |
angular | |
.module('app', []) | |
.controller('HomeController', HomeController); | |
function HomeController ($scope) { | |
$scope.hello = "oh, hi" | |
} |
NewerOlder