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
| // Hyperscope | |
| // Upgrading $scope.$watch, making some new friends | |
| angular.module('hyperscope', []) | |
| // service for extending $scope objects | |
| .factory('Hyperscope', function($parse, $rootScope){ | |
| var vanillaAdditions = { |
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
| FIELDS = ['cmd', 'command', 'start', 'end', 'delta', 'msg', 'stdout', 'stderr'] | |
| def human_log(res): | |
| if type(res) == type(dict()): | |
| for field in FIELDS: | |
| if field in res.keys(): | |
| encoded_field = res[field].encode('utf-8') | |
| print '\n{0}:\n{1}'.format(field, encoded_field) | |
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('currencyMask', []) | |
| .directive('currencyMask', function () { | |
| return { | |
| restrict: 'A', | |
| require: 'ngModel', | |
| link: function (scope, element, attrs, ngModelController) { | |
| // Run formatting on keyup | |
| var numberWithCommas = function(value, addExtraZero) { |
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
| module.exports = function(config) { | |
| config.set({ | |
| basePath: '', | |
| frameworks: ['jasmine'], | |
| files: [ | |
| // lib | |
| './app/lib/angular/angular.js', | |
| './app/lib/**/angular-*.js', | |
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
| <script type="text/javascript"> | |
| var custom = "myapp://custom_url"; | |
| var alt = "http://mywebsite.com/alternate/content"; | |
| var g_intent = "intent://scan/#Intent;scheme=zxing;package=com.google.zxing.client.android;end"; | |
| var timer; | |
| var heartbeat; | |
| var iframe_timer; | |
| function clearTimers() { | |
| clearTimeout(timer); |
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
| // http://paulirish.com/2011/requestanimationframe-for-smart-animating/ | |
| // http://my.opera.com/emoller/blog/2011/12/20/requestanimationframe-for-smart-er-animating | |
| // requestAnimationFrame polyfill by Erik Möller. fixes from Paul Irish and Tino Zijdel | |
| // MIT license | |
| (function() { | |
| var lastTime = 0; | |
| var vendors = ['ms', 'moz', 'webkit', 'o']; |
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
| /*! | |
| * isVis - v0.5.5 Aug 2011 - Page Visibility API Polyfill | |
| * Copyright (c) 2011 Addy Osmani | |
| * Dual licensed under the MIT and GPL licenses. | |
| */ | |
| (function () { | |
| window.visibly = { | |
| b: null, | |
| q: document, |
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
| // geo-location shim | |
| // currentely only serves lat/long | |
| // depends on jQuery | |
| // doublecheck the ClientLocation results because it may returning null results | |
| ;(function(geolocation){ | |
| if (geolocation) return; |
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
| CREATE OR REPLACE FUNCTION escape_json (text) RETURNS text AS $$ | |
| SELECT replace($1, '''', '\'''); $$ LANGUAGE SQL IMMUTABLE; | |
| CREATE OR REPLACE FUNCTION to_json(text) RETURNS text AS $$ | |
| SELECT escape_json($1) $$ LANGUAGE SQL IMMUTABLE; | |
| CREATE OR REPLACE FUNCTION to_json(KEY text, value text) RETURNS text AS $$ | |
| SELECT '''' || to_json($1) || ''': ''' || to_json($2) || ''''; $$ LANGUAGE SQL IMMUTABLE; |