Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
Considering new contract opportunities at this time

Andrew E. Rhyne thebigredgeek

💭
Considering new contract opportunities at this time
View GitHub Profile
View gist:6789721
// Karma configuration
// Generated on Wed Sep 18 2013 14:27:40 GMT-0700 (PDT)
module.exports = function(config) {
config.set({
// base path, that will be used to resolve files and exclude
basePath: '',
View gist:6790031
// list of files / patterns to load in the browser
files: [
'vendor/managed/angular/angular.js',
'vendor/managed/angular-mocks/angular-mocks.js',
'src/js/**/{%=name%}.js',
'src/js/**/!({%=name%}).js',
'test/unit/**/*.spec.js'
],
View gist:6849609
angular.module("angularQuiz").controller "RegisterModalController",
class RegisterModalController
prvScope = null #prototype private scope member
prvModalInstance = null #prototype private modal instance
prvAPIService = null #prototype private api service
constructor: ($scope,$modalInstance, APIService) ->
View gist:6859145
$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);
}
View gist:6868057
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);
View gist:6871242
$rootScope.$safeApply = function(fn) {
var phase;
phase = this.$root.$$phase;
if (phase === '$apply' || phase === '$digest') {
if (fn) {
fn();
}
} else {
this.$apply(fn);
}
View gist:6871855
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");
View gist:6872315
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();
View gist:6880344
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:
@thebigredgeek
thebigredgeek / gist:6943195
Last active Dec 25, 2015
Facebook passport
View gist:6943195
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