Source : Learn to combine RxJs sequences with super intuitive interactive diagrams
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
| /** | |
| * Traversing tree-like data structures, returning items on provided depth level | |
| * Works on flat or deep-nested structures | |
| * @param root Root node | |
| * @param {number} depth Desired depth level | |
| * @param {Function} getter fn to provide node's children | |
| */ | |
| function findByDepth(root, depth, getter) { | |
| if (root == null) throw new Error('No root node was provided!'); |
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
| 'use strict'; | |
| angular.module('yourApp') | |
| .constant('Config', { | |
| viewDir: 'views/', | |
| API: { | |
| useMocks: true, | |
| fakeDelay: 2000, | |
| protocol: window.location.protocol.split(':')[0], | |
| host: window.location.hostname, |
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
| /* ------------------------ */ | |
| /* LESS mixin for CSS arrow */ | |
| /* ------------------------ */ | |
| /* https://github.com/HugoGiraudel/LESS-Mixin-for-CSS-arrows | |
| //Usage | |
| .arrow(size, color, direction, offset, border-size, border-color); | |
| Where |
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
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <title>Box Shadow</title> | |
| <style> | |
| .box { | |
| height: 150px; | |
| width: 300px; | |
| margin: 20px; |
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 () { | |
| 'use strict'; | |
| angular | |
| .module('mymodule') | |
| .factory('poller', poller); | |
| /** @ngInject */ | |
| function poller($timeout, config) { |
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
| app.factory('socket', function ($rootScope) { | |
| // Underscore.js 1.4.3 | |
| // http://underscorejs.org | |
| // (c) 2009-2012 Jeremy Ashkenas, DocumentCloud Inc. | |
| // Underscore may be freely distributed under the MIT license. | |
| // _.throttle | |
| // https://github.com/documentcloud/underscore/blob/master/underscore.js#L626 | |
| // Returns a function, that, when invoked, will only be triggered at most once |
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
| Number.prototype._toFixed = function( precision ) { | |
| var power = Math.pow(10, precision + 1); | |
| var wholeNumber = Math.round( this * power ); | |
| return +(Math.round( wholeNumber / 10 ) * 10 / power).toFixed(2); | |
| } |


