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(scope){ //injected scope to bind | |
scope.QLite = {}; | |
var publicMembers = scope.QLite, //bind publicMembers to the injected scope | |
privateMembers = {}; //private members hash for internal closure members | |
privateMembers.promise = function(){ //the promise object | |
var self = this, | |
queue = {}; |
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
var InheritableCleanObject = function(){ | |
var publicMembers = this, | |
privateMembers = {}; | |
publicMembers.hello = function(){ | |
return "world"; | |
}; | |
InheritableCleanObject.prototype = publicMembers; | |
} |
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
/** | |
* This controller is used by youtubeItem directives | |
* @name angulartodo#youtubeItemController | |
* @param {Object} $scope An instance of $scope | |
* @param {Object} $attrs An object containing html attributes bound to this directive | |
*/ | |
angular.module('angulartodo').controller('youtubeItemController',[ | |
'$scope','$attrs', | |
function($scope, $attrs){ | |
console.log("hello world!"); |
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
var passport = require('passport'), | |
FacebookStrategy = require('passport-facebook').Strategy; | |
/** | |
* This function handles passport verification | |
* @param {Object} token Token | |
* @param {Object} tokenSecret Token secret | |
* @param {Object} profile Information regarding this user |
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
andrew@andrew-desktop:~/WebstormProjects/angular-quiz$ jitsu deploy | |
info: Welcome to Nodejitsu rhyneandrew | |
info: jitsu v0.13.2, node v0.10.18 | |
info: It worked if it ends with Nodejitsu ok | |
info: Executing command deploy | |
info: Analyzing application dependencies in node index.js | |
warn: Local package version appears to be old | |
warn: The package.json version will be incremented automatically | |
warn: About to write /home/andrew/WebstormProjects/angular-quiz/package.json | |
data: |
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
var $q = {defer:function(){return {reject:function(){},resolve:function(){},promise:{}}}} | |
var db = {query:function(x,y,z){z();}}; | |
var $rootScope = {$apply:function(fn){fn();}}; | |
var x = { | |
getEvents: function() { | |
var matchCallback = null; | |
var reduce = null; | |
var deferred = $q.defer(); |
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
FBase.prototype.register = function(email, password) { | |
var killFailureListener, killSuccessListener, promise, self; | |
this.regDeferral = _q.defer(); | |
self = this; | |
promise = this.regDeferral.promise; | |
killSuccessListener = null; | |
killFailureListener = null; | |
killSuccessListener = _rootScope.$once("angularFireAuth:login", function(event, user) { | |
killFailureListener(); | |
console.log("hello"); |
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
$rootScope.$safeApply = function(fn) { | |
var phase; | |
phase = this.$root.$$phase; | |
if (phase === '$apply' || phase === '$digest') { | |
if (fn) { | |
fn(); | |
} | |
} else { | |
this.$apply(fn); | |
} |
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
login: () => | |
self = this | |
@$scope.data.toggle = false #toggle the buttons off | |
@FB.login(@$scope.data.email, @$scope.data.password).then ((data)-> # Try to login | |
self.$modalInstance.close # If successful, close the modal | |
email: self.$scope.data.email # and pass the email address | |
),(reason)-> # If failure | |
console.log(reason); |
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
$rootScope.$safeApply = function (fn) { #safe apply can be accessed from any $scope | |
var phase; | |
phase = this.$root.$$phase; | |
if (phase === '$apply' || phase === '$digest') { | |
if (fn) { | |
fn(); | |
} | |
} else { | |
this.$apply(fn); | |
} |