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
#!/bin/sh | |
error() { echo "$@" 1>&2; } | |
domain_files=$1 | |
if [ -z $domain_files ]; then | |
error "What is the file with the domains?" | |
exit 1 | |
fi |
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 products = [{ sku: 1 }, { sku: 2 }]; // Sample data (SKU of products from Magento Database) | |
var productsSku = products | |
.map(product => (product.sku || '').toString()) | |
.map(sku => sku.split(' ').filter(node => node.match(/^\S+$/))) | |
.reduce((acc, target) => Array.prototype.concat.apply(acc, target)) | |
.filter((value, index, self) => self.indexOf(value) === index) | |
.map(sku => `'${sku}'`) | |
.sort((x, y) => x - y) | |
.join(', '); |
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
// CTRL+F | |
Match pattern: (.+)[\t\s]+([0-9]+\:[0-9]+\:[0-9]+)[\t\s]+(.+) | |
Replace pattern: [$2] $1 - $3 |
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 bytes(e,r){return"string"==typeof e?parse(e):"number"==typeof e?format(e,r):null}function format(e,r){if(!numberIsFinite(e))return null;var a=Math.abs(e),t=r&&r.thousandsSeparator||"",n=r&&void 0!==r.decimalPlaces?r.decimalPlaces:2,i=Boolean(r&&r.fixedDecimals),o="B";a>=map.tb?o="TB":a>=map.gb?o="GB":a>=map.mb?o="MB":a>=map.kb&&(o="kB");var m=e/map[o.toLowerCase()],s=m.toFixed(n);return i||(s=s.replace(formatDecimalsRegExp,"$1")),t&&(s=s.replace(formatThousandsRegExp,t)),s+o}function parse(e){if("number"==typeof e&&!isNaN(e))return e;if("string"!=typeof e)return null;var r=parseRegExp.exec(e);if(null===r)return null;var a=parseFloat(r[1]),t=(r[4]||"b").toLowerCase();return Math.floor(map[t]*a)}var formatThousandsRegExp=/\B(?=(\d{3})+(?!\d))/g,formatDecimalsRegExp=/(?:\.0*|(\.[^0]+)0+)$/,map={b:1,kb:1024,mb:1<<20,gb:1<<30,tb:1024*(1<<30)},numberIsFinite=Number.isFinite||function(e){return"number"==typeof e&&isFinite(e)},parseRegExp=/^((-|\+)?(\d+(?:\.\d+)?)) *(kb|mb|gb|tb|b)?$/i; | |
var isResumeNode = ( |
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('lib.decorators', []) | |
.config(['$provide', function($provide){ | |
'use strict'; | |
var isSafari = /Safari/.test(navigator.userAgent) && /Apple Computer/.test(navigator.vendor); | |
if(isSafari) { | |
$provide.decorator('$rootScope', ['$delegate', function($rootScope) { | |
var scopePrototype = Object.getPrototypeOf($rootScope); | |
var originalScopeNew = scopePrototype.$new; |
NewerOlder