This file contains 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 () { | |
var COMPILED = !0, | |
goog = goog || {}; | |
goog.global = this; | |
goog.DEBUG = !0; | |
goog.LOCALE = "en"; | |
goog.provide = function (a) { | |
if (!COMPILED) { | |
if (goog.isProvided_(a)) throw Error('Namespace "' + a + '" already declared.'); | |
delete goog.implicitNamespaces_[a]; |
This file contains 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
angular.module('app') | |
.controller('ImageUpload', ['$scope', '$log', | |
function ImageUpload($scope, $log) { | |
$scope.upload_image = function (image) { | |
if (!image.valid) return; | |
var imagesRef, safename, imageUpload; | |
image.isUploading = true; | |
imageUpload = { |
This file contains 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 Firebase = require('firebase'); | |
var Request = require('./request.js'); | |
var Reply = require('./reply.js'); | |
var Tasks = require('./tasks'); | |
var Queue = require('./queue.js'); | |
var fb = new Firebase(process.env.FIREBASE_URL).child('queue'); | |
fb.auth(process.env.FIREBASE_TOKEN, function(err) { | |
if(err) { throw err; } | |
else { |
This file contains 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 __hasProp = {}.hasOwnProperty, | |
__extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }; | |
angular.module('myApp', ['ngCookies']).factory('BaseObject', [ | |
'$log', '$http', function($log, $http) { | |
var BaseObject; | |
return BaseObject = (function() { | |
function BaseObject(options) { | |
this.options = options; |
This file contains 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 code is a working example of the code shown in the 12devs[0]'s article: | |
"Rapid Prototyping with AngularJS"[1] by Tom Ashworth[2]. | |
I put it here for reference ;-) | |
[0] http://12devs.co.uk | |
[1] http://12devs.co.uk/articles/rapid-prototyping-with-angularjs/ | |
[2] http://twitter.com/phuunet |
This file contains 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 little helper is called instead of on() to monitor data and handle auth expiration | |
* It assumes that you monitor authentication state and re-auth if | |
* your auth token expires. It also doesn't help with any transactions, set ops, or | |
* other writes which could be in progress when authentication is lost--those will | |
* explode in glorious flashes of failure | |
* | |
* To support IE8, you will want these polyfills: | |
* forEach: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/forEach#Polyfill | |
* indexOf: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/indexOf#Polyfill |
This file contains 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
// Helper function to extract claims from a JWT. Does *not* verify the | |
// validity of the token. | |
// credits: https://github.com/firebase/angularFire/blob/master/angularFire.js#L370 | |
// polyfill window.atob() for IE8: https://github.com/davidchambers/Base64.js | |
// or really fast Base64 by Fred Palmer: https://code.google.com/p/javascriptbase64/ | |
function deconstructJWT(token) { | |
var segments = token.split("."); | |
if (!segments instanceof Array || segments.length !== 3) { | |
throw new Error("Invalid JWT"); | |
} |
This file contains 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
web: node app.js | |
worker: node consumer.js |
This file contains 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
'use strict'; | |
/** | |
* This module monitors angularFire's authentication and performs actions based on authentication state. | |
* directives/directive.ngcloakauth.js depends on this file | |
* | |
* Modify ng-cloak to hide content until FirebaseSimpleLogin resolves. Also | |
* provides ng-show-auth methods for displaying content only when certain login | |
* states are active. | |
* |
This file contains 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 mongoose = require('mongoose'); | |
mongoose.connect('localhost', 'testing_multiTenant'); | |
/** | |
* User schema. | |
*/ | |
var UserSchema = new mongoose.Schema({ | |
name: String | |
, prefix: { type: String, required: true } |