Skip to content

Instantly share code, notes, and snippets.

View shakirullahi's full-sized avatar
🔆
hakuna matata

Sakirullahi Puthenchirakkal shakirullahi

🔆
hakuna matata
View GitHub Profile
/**
* r-proto-class.js
* Ruby's semantics
*
* Features:
* - super calls
* - using Object.create for inheritance
* - Class.new is a wrapper over Class.allocate and Class.initialize
*
* by Dmitry Soshnikov <dmitry.soshnikov@gmail.com>
angular.module('waitForAuth', [])
/**
* A service that returns a promise object, which is resolved once angularFireAuth
* is initialized (i.e. it returns login, logout, or error)
*/
.service('waitForAuth', function($rootScope, $q, $timeout) {
var def = $q.defer(), subs = [];
subs.push($rootScope.$on('angularFireAuth:login', fn));
subs.push($rootScope.$on('angularFireAuth:logout', fn));
// pros: does not fetch entire record set
// cons: grabs the last record which needs to be ignored
var first = true;
var ref = new Firebase(...);
ref.endAt().limit(1).on("child_added", function(snap) {
if( first ) {
first = false;
}
else {
console.log('new record', snap.val());
#!/bin/bash
# change docRoot
docRoot=~/src/shakir/
for semester in */;
do
semester="${semester%?}"
cd "$docRoot/$semester/"
for branch in */;
@shakirullahi
shakirullahi / Gearman-Windows.md
Created July 20, 2016 16:51 — forked from mnapoli/Gearman-Windows.md
Installing Gearman on windows

Gearman can be installed on Windows through cygwin.

Install Cygwin packages

Install cygwin packages (through setup.exe):

  • gcc
  • make
  • libuuid1-devel
  • libiconv