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
| Array.from($$('.folder__price-label')) | |
| .map(item => item.textContent.split('€')[0].trim().replace(',', '.')) | |
| .map(Number) | |
| .reduce((accus, item) => accus + item, 0); |
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
| // Version without jQuery | |
| javascript:(function () { var root = angular.element(document.getElementsByTagName('body')); var watchers = []; var f = function (element) { angular.forEach(['$scope', '$isolateScope'], function (scopeProperty) { if (element.data() && element.data().hasOwnProperty(scopeProperty)) { angular.forEach(element.data()[scopeProperty].$$watchers, function (watcher) { watchers.push(watcher); }); } }); angular.forEach(element.children(), function (childElement) { f(angular.element(childElement)); }); }; f(root); var watchersWithoutDuplicates = []; angular.forEach(watchers, function(item) { if(watchersWithoutDuplicates.indexOf(item) < 0) { watchersWithoutDuplicates.push(item); } }); console.log(watchersWithoutDuplicates.length); })(); | |
| // Version with jQuery | |
| javascript:(function () { var root = $(document.getElementsByTagName('body')); var watchers = []; var f = function (element) { if (element.data().hasOwnProperty('$scope')) { angular.forEach(element.data().$scope.$$watchers, function (watche |
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
| cd /var/www | |
| for i in $(seq 10) | |
| do | |
| echo Start monsite$i | |
| forever start --uid=monsite$i -a monsite1path/monsite$i.js | |
| done |
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 gulp = require('gulp'), | |
| tap = require('gulp-tap'), | |
| gutil = require('gulp-util'), | |
| babel = require("gulp-babel"), | |
| concat = require("gulp-concat"), | |
| plumber = require('gulp-plumber'), | |
| uglify = require('gulp-uglify'), | |
| replace = require('gulp-replace'), | |
| sourcemaps = require('gulp-sourcemaps'), | |
| cached = require('gulp-cached'), |
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
| <form-submit></form-submit> |
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
| /** | |
| * Build query params for an url | |
| * @param {Object} config key=>value | |
| * @return {String} | |
| */ | |
| function getQuery(config) { | |
| var query = Object | |
| .keys(config || {}) | |
| .reduce(function (accus, key) { |
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
| /** | |
| * Compute the network type | |
| * @link http://caniuse.com/#feat=resource-timing | |
| */ | |
| function getNetwork() { | |
| var js = performance.getEntriesByName(location.origin + '/js/vendor.min.js')[0] || {duration: 290}; | |
| var DELTA = js.duration * 1.2; | |
| // Base calcul for a file 80ko Gzipped | |
| var map = { |
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('core', ['ui.router']) | |
| .config(function ($stateProvider, $urlMatcherFactoryProvider) { | |
| 'use strict'; | |
| $urlMatcherFactoryProvider | |
| .type("raw", { | |
| encode: function(val) {return val;}, | |
| decode: function(val) {return val;} | |
| }); |
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
| (() => { | |
| const CLASS_LIST = [ | |
| {type: 'added', className: '.lines-added'}, | |
| {type: 'removed', className: '.lines-removed'} | |
| ]; | |
| const stats = CLASS_LIST | |
| .reduce((accus, o) => { | |
| const total = Array |
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/bash | |
| # Base directory containing a list of directories with some picture inside of them | |
| BASE='XXX'; | |
| cd $BASE ; | |
| for directory in * | |
| do | |
| echo 'Go to ' $directory; | |
| # Prevent some errors if the name is such as 'Le pull de polo' |