Skip to content

Instantly share code, notes, and snippets.

@sagivf
sagivf / RethinkDB count issue and solutions.md
Last active March 18, 2017 22:00
RethinkDB count issue and solutions
@sagivf
sagivf / add-ajax-state.js
Last active August 29, 2015 14:27
Angular DRY mocking
leoConfiguration.addStates([
{
name: 'flicker-images',
verb: "jsonp",
url: 'http://api.flickr.com/services/feeds/photos_public.gne',
options: [
{
name: 'get ninja turtles', status: 200,
data: {
"items": [
/* ES5 code, without classes */
var Civilian = function Civilian(name) {
this.name = name;
};
Civilian.prototype.danger = function () { console.log("Run away!"); };
var SuperHero = function(name, ability) {
Civilian.call(this, name); // Call the super class constructor.
this.ability = ability;
};
@sagivf
sagivf / FileDownload.js
Last active July 21, 2016 23:23
The power of promises in file downloading
angular.module("fileDownload", []);