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
@echo off | |
color e9 | |
goto :CHECKPERMS | |
:RUN | |
:: Kill all IE processes | |
taskkill /f /im iexplore.exe /t >nul 2>&1 | |
ping -n 1 127.0.0.1 >nul 2>&1 |
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
@echo off | |
echo ##### ## ##### # ##### ## | |
echo ###### /### ###### / ###### /### | |
echo /# / / ### /# / / /# / / ### | |
echo / / / ### / / / / / / ### | |
echo / / ## / / / / ## | |
echo ## ## ## ## ## ## ## ## | |
echo ## ## ## ## ## ## ## ## | |
echo /### ## / /### ## /### ## / |
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
// implements method | |
if (typeof Function.prototype.method !== "function") { | |
Function.prototype.method = function (name, implementation) { | |
this.prototype[name] = implementation; | |
return this; | |
}; | |
} |
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
# ----------------------------- | |
# Custom PowerShell Profile | |
# By: Philip Smith | |
# ----------------------------- | |
# Requires -Version 3 | |
# ----------------------------- | |
# Customizable Variables | |
# ----------------------------- |
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
/* | |
* Tuple.js - JavaScript Tuple Implmentation | |
* ------------------------------------------------ | |
* The Tuple object is an immutable, fixed-length | |
* structure used to hold a heterogeneous set of n | |
* typed values that can be used for inter-function | |
* communication. For instance, you can use it to | |
* build quick value objects. | |
* |
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 object extension to add memoization | |
* to any single-argument function. | |
*/ | |
Function.prototype.memoized = function () { | |
let key = JSON.stringify(arguments); | |
this._cache = this._cache || {}; | |
this._cache[key] = this._cache[key] || | |
this.apply(this, arguments); |
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
// factorial (imperitive) | |
const factorial = n => { | |
let result = 1; | |
while (n > 1) { | |
result *=n; | |
n--; | |
} | |
return result; | |
}; |
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 map = fn => array => array.map(fn); | |
const multiply = x => y => x * y; | |
const pluck = key => object => object[key]; | |
const discount = multiply(0.98); | |
const tax = multiply(1.0925); | |
const custReq = request({ | |
headers: { 'X-Custom': 'mykey' } |
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
// using bind() | |
const partialBind = (fn, ...args) => { | |
return fn.bind(null, ...args); | |
}; | |
// with a closure | |
const partial = (fn, ...args) => { | |
return (...moreArgs) => { | |
return fn(...args, ...moreArgs) | |
}; |
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
// Dependency Injection | |
const assert = require('assert') | |
function getAnimals(fetch, id) { | |
return fetch('http://api.animalfarmgame.com/animals/' + id) | |
.then(response => response.json()) | |
.then(data => data.results[0]) | |
} |
OlderNewer