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
| function makeList(ref) { | |
| var fruits = ["banana", "apple", "grape", "orange"]; | |
| for (var i = 0; i < fruits.length; i++) { | |
| ref.push(fruits[i]); | |
| } | |
| } | |
| function getFirstFromList(ref, cb) { | |
| ref.startAt().limit(1).once("child_added", function(snapshot) { | |
| cb(snapshot.val()); |
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
| function Defer(callback){ | |
| if(!this instanceof Defer) | |
| return new Defer(callback); | |
| var queue = [] | |
| , callback = callback | |
| , slice = Array.prototype.slice | |
| , changeling = function(){ | |
| queue.push({ | |
| 'context': this, |
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
| class UsersController < ApplicationController | |
| respond_to :html, :json | |
| def index | |
| @json = User.all.to_gmaps4rails | |
| respond_with @json | |
| end | |
| end |
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
| require "time" | |
| require "date" | |
| class Date | |
| def to_time | |
| Time.local(year, month, day) | |
| end | |
| end | |
| class Time |