Update nginx config to support a longer timeout to prevent it dropping the connection when trying to debug in PHP Storm
fastcgi_read_timeout 600; # Set fairly high for debugging
| # See list of docker virtual machines on the local box | |
| $ docker-machine ls | |
| NAME ACTIVE URL STATE URL SWARM DOCKER ERRORS | |
| default * virtualbox Running tcp://192.168.99.100:2376 v1.9.1 | |
| # Note the host URL 192.168.99.100 - it will be used later! | |
| # Build an image from current folder under given image name | |
| $ docker build -t gleb/demo-app . |
| // === Arrays | |
| var [a, b] = [1, 2]; | |
| console.log(a, b); | |
| //=> 1 2 | |
| // Use from functions, only select from pattern | |
| var foo = () => [1, 2, 3]; |
| //- https://github.com/pugjs/pug/issues/1852 | |
| mixin tabs(tabsItems) | |
| - var tabActive = function (t) { return t.active ? 'active' : '' } | |
| mixin tab(index) | |
| - tabsItems[index].body = block; | |
| block | |
| - tabsItems[0].active = tabsItems[0].active || !tabsItems.some(function (t) { return t.active; }) |
| function getCount(words) { | |
| var words = (typeof words == 'string') ? words : '', | |
| count = re => (words.match(re) || []).length, //when match fails to match, it returns null | |
| vowels = count(/[aeiou]/ig), //g - return all matches, not only the first one | |
| consonants = count(/[bcdfghjklmnpqrstvxzwy]/ig); | |
| return {vowels, consonants}; | |
| } |
| // array utils | |
| // ================================================================================================= | |
| const combine = (...arrays) => [].concat(...arrays); | |
| const compact = arr => arr.filter(Boolean); | |
| const contains = (() => Array.prototype.includes | |
| ? (arr, value) => arr.includes(value) | |
| : (arr, value) => arr.some(el => el === value) |
| function defaults(_defaults, opts) { | |
| opts = opts || {}; | |
| return angular.extend(angular.copy(_defaults), opts); | |
| } | |
| function foo(options) { | |
| var _defaults = { | |
| bar: 'baz' | |
| }; | |
| options = defaults(_defaults, options); | |
| } |
| (function() { | |
| 'use strict'; | |
| //http://stackoverflow.com/a/26086754/5807080 | |
| angular | |
| .module('blocks.uirouterlogger') | |
| .factory('uirouterlogger', uirouterlogger); | |
| uirouterlogger.$inject = ['$rootScope', '$log']; |