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
| angular.module('firebase-example', ['js-data', 'ngRoute']) | |
| .config(function (DSFirebaseAdapterProvider, $routeProvider) { | |
| var basePath = 'https://js-data-firebase.firebaseio.com'; | |
| DSFirebaseAdapterProvider.defaults.basePath = basePath; | |
| $routeProvider.when('/user/:id', { | |
| controller: 'UserCtrl', | |
| controllerAs: 'UserCtrl', | |
| template: 'routes/user/user.html', | |
| resolve: { |
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 cordova; | |
| cordova = { | |
| exec: function(listener, errorHandler, pluginName, action, payload) { | |
| return console.log("Received " + action + " with payload:", payload); | |
| } | |
| }; |
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
| adb shell screencap -p | perl -pe 's/\x0D\x0A/\x0A/g' > screen.png |
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
| git remote | grep -q frbit-stage || git remote add frbit-stage git@git1.eu1.frbit.com:my-app-stage.git | |
| git push frbit-master refs/heads/stage:refs/heads/master |
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 SecurityService | |
| @$inject:['$http','sessionService', 'api'] | |
| constructor:(@http, @session, @api) -> | |
| login:(username, password) => | |
| @http.get "#{@api.base}/security/login/credentials/#{username}/#{password}" | |
| .success (user)=> | |
| @session.isAuthenticated = true | |
| @session.user = user | |
| .error (ex)=> |
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
| injector = angular.element(document.body).injector() |
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
| # dependency - Function.prototype.bind or underscore/lodash | |
| app = angular.module 'someApp' | |
| class @BaseCtrl | |
| @register: (app, name) -> | |
| name ?= @name || @toString().match(/function\s*(.*?)\(/)?[1] | |
| app.controller name, @ | |
| @inject: (args...) -> |
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
| ExampleController = ($scope, LocationService) -> | |
| LocationService.locate().then (position) -> | |
| $scope.position = position | |
| ExampleController.$inject = ["$scope", "LocationService"] | |
| YourAngularApp.controller("ExampleController", ExampleController) |
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
| Services.factory("LawnchairFactory", function($window, $log, $parse) { | |
| return function(name, config) { | |
| var collection = {}; | |
| var array = []; | |
| var isArray = config && config.isArray; | |
| var idGetter = $parse((config && config.entryKey) ? config.entryKey : "id"); | |
| var transformSave = (config && config.transformSave) ? config.transformSave : angular.identity; | |
| var transformLoad = (config && config.transformLoad) ? config.transformLoad : angular.identity; | |
| function getEntryId(entry){ |
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
| /*global localStorage*/ | |
| /** | |
| * The Cacher Module with the service CacheLocal | |
| */ | |
| angular.module('Cacher', []). | |
| factory('CacheLocal', function($cacheFactory) { | |
| var cache = $cacheFactory('someCache', {}); | |
| var PREFIX = 'Cacher::'; |