This file contains 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 linter; \ | |
./pslint_selftest.sh; \ | |
./pslint.py ../public_suffix_list.dat; | |
-n test_NFKC: | |
OK | |
-n test_allowedchars: | |
OK | |
-n test_dots: | |
OK | |
-n test_duplicate: |
This file contains 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 {compile, root, chain, setter, arg0} = require('carmi'); | |
const Benchmark = require('benchmark'); | |
const assert = require('assert'); | |
async function go() { | |
class Implementation1 { | |
constructor(data) { | |
this.data = data; | |
} | |
setup() { |
This file contains 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
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" | |
brew install git | |
brew install zsh | |
brew install node | |
curl -L http://install.ohmyz.sh | sh | |
echo 'alias npmpublic="npm config set registry https://registry.npmjs.org/"' >> ~/.zshrc | |
echo 'alias npmprivate="npm config set registry http://npm.dev.wixpress.com"' >> ~/.zshrc | |
npm install -g fed-exam --registry http://npm.dev.wixpress.com |
This file contains 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 aBuilderFor(obj) { | |
const cap = s => s.charAt(0).toUpperCase() + s.slice(1); | |
return () => new function () { | |
Object.keys(obj).forEach(key => { | |
this[`with${cap(key)}`] = value => { | |
this[`_${key}`] = value; | |
return this; | |
}; | |
this[`_${key}`] = typeof obj[key] === 'function' ? obj[key]() : obj[key]; | |
}); |
This file contains 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
brew list | xargs -I % sh -c 'brew unlink %; brew link %' | |
ln -s /usr/local/lib/node_modules/npm/bin/npm-cli.js /usr/local/bin/npm | |
for i in "$(npm prefix -g)/lib/node_modules/"*; do | |
npm build -g "$i" | |
done |
This file contains 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('shahata', []) | |
.directive('debounce', function($timeout) { | |
return { | |
require: 'ngModel', | |
scope: { | |
debounce: '=' | |
}, | |
link: function($scope,$element, $attrs, ngModelController) { | |
var pending, viewValue; | |
var prevRender = ngModelController.$render.bind(ngModelController); |
This file contains 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 consoleLog(type) { | |
var console = window.console || {}, | |
logFn = console[type] || console.log || function() {}, | |
hasApply = false; | |
// Note: reading logFn.apply throws an error in IE11 in IE8 document mode. | |
// The reason behind this is that console.log has type "object" in IE8... | |
try { | |
hasApply = !! logFn.apply; | |
} catch (e) {} |
This file contains 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
//requirements: | |
//npm install cldr | |
//npm install csv | |
//npm install path | |
'use strict'; | |
var cldr = require('cldr'); | |
var csv = require('csv'); | |
var path = require('path'); |
This file contains 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'; | |
// createAsyncSpy helps you mock functions that invoke callbacks. | |
// createAsyncSpy gets two function parameters: mock() and work() | |
// | |
// mock() is invoked when the user calls spy() | |
// work() is called when the user calls spy.flush() | |
// Both mock() and work() are called with the context and arguments the user passed in his original | |
// invocation. | |
// |