- https://github.com/postcss/autoprefixer
- https://github.com/BrowserSync/gulp-browser-sync
- https://github.com/floatdrop/gulp-watch
- https://github.com/jonschlinkert/gulp-htmlmin
- https://github.com/ben-eb/gulp-uncss
- https://github.com/terinjokes/gulp-uglify
- https://github.com/contra/gulp-concat
- https://github.com/bezoerb/gulp-htmlhint
- https://github.com/sindresorhus/gulp-imagemin
- https://github.com/otouto/gulp-spritesmith
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
var prompt = require('prompt'); | |
var util = require('util'); | |
var Player = function(options) { | |
this.name = options.name; | |
this.attributes = options.attributes || { | |
str: 10, | |
int: 10, | |
wis: 10, | |
dex: 10, |
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
var Adventurer = function(options) { | |
this.name = options.name; | |
this.gender = options.gender; | |
this.class = options.class; | |
this.race = options.race; | |
this.position = options.position || 'standing'; | |
this.effects = []; | |
this.hits = []; |
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
module Excel | |
module Formulas | |
def pmt(rate, nper, pv, fv=0, type=0) | |
((-pv * pvif(rate, nper) - fv ) / ((1.0 + rate * type) * fvifa(rate, nper))) | |
end | |
def ipmt(rate, per, nper, pv, fv=0, type=0) | |
p = pmt(rate, nper, pv, fv, 0); | |
ip = -(pv * pow1p(rate, per - 1) * rate + p * pow1pm1(rate, per - 1)) | |
(type == 0) ? ip : ip / (1 + rate) |
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() { | |
Date.prototype.today = function() { | |
var date = this; | |
var beginningOfMonth = function() { | |
var bom = new Date(date.getFullYear(), date.getMonth(), 1); | |
var beginningOfWeek = function() { | |
var day = bom.getDay(); |
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
var Node = function(a, b) { | |
this.data = {a: a, b: b }; | |
this.parent = undefined; | |
this.children = []; | |
return this; | |
}; | |
Node.prototype.isSpinner = function() { | |
return this.data.a === this.data.b; |
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
// If we list all the natural numbers below 10 that are | |
// multiples of 3 or 5, we get 3, 5, 6 and 9. The sum of | |
// these multiples is 23. | |
// | |
// Find the sum of all the multiples of 3 or 5 below 1000. | |
if (typeof(Array.prototype.flatMap) != "function") { | |
// warning, we are mutating the actual base prototype for Array here | |
Array.prototype.flatMap = function(fn) { | |
return Array.prototype.concat.apply([], this.map(fn)); |
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
Array.prototype.flatMap = function(fn) { | |
return Array.prototype.concat.apply([], this.map(fn)); | |
}; | |
Array.prototype.shuffle = function() { | |
var m = this.length, t, i; | |
// While there remain elements to shuffle… | |
while (m) { |