duplicates = multiple editions
A Classical Introduction to Modern Number Theory,Kenneth IrelandMichael Rosen
A Classical Introduction to Modern Number Theory,Kenneth IrelandMichael Rosen
function each (array, callback) { | |
for (var i = 0; i < array.length; i++) { | |
callback(array[i]); | |
} | |
} | |
each([2, 6, 7], console.log); // => 2, 6, 7 | |
function mapEach (array, callback) { | |
var result = []; |
var https = require('https'); | |
var fs = require('fs'); | |
var url = 'https://raw.githubusercontent.com/dconnolly/chromecast-backgrounds/master/backgrounds.json'; | |
Array.prototype.getLast = function() { | |
return this[this.length - 1]; | |
}; | |
function logFail(err){ | |
console.log('Failed!'); |
var arr = [1, 2, 4, 7, 9, 6, 3]; | |
function flatten() { | |
return [].reduce.call(arguments, function(sum, val) { | |
return Array.isArray(val) ? sum.concat(flatten.apply(null, val)) : sum.concat(val); | |
}, []); | |
} | |
function shuffle (array) { | |
var temp = []; |
/* | |
* memoize.js | |
* by @philogb and @addyosmani | |
* further optimizations by @mathias | |
* Released under an MIT license. | |
*/ | |
function memoize( fn ) { | |
return function () { | |
var args = Array.prototype.slice.call(arguments), | |
hash = "", |
Copyright 2012 Shin Suzuki<shinout310@gmail.com> | |
Licensed under the Apache License, Version 2.0 (the "License"); | |
you may not use this file except in compliance with the License. | |
You may obtain a copy of the License at | |
http://www.apache.org/licenses/LICENSE-2.0 | |
Unless required by applicable law or agreed to in writing, software | |
distributed under the License is distributed on an "AS IS" BASIS, |
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
function reverse(val) { | |
return val.split('').reverse().join('') | |
} | |
function add(a, b) { | |
var rBig, rSmall; | |
if ( Number(a) < Number(b) ) { | |
rBig = reverse(b); | |
rSmall = reverse(a); | |
} else { |
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Leaflet.FileLayer Plugin</title> | |
<meta charset="utf-8" /> | |
<link | |
rel="stylesheet" | |
href="http://cdn.leafletjs.com/leaflet-0.7/leaflet.css" | |
/> | |
<link |
"use strict"; | |
// simple fisher yates implementation | |
const shuffle = (deck) => { | |
let randomizedDeck = []; | |
let array = deck; | |
while ( array.length !== 0) { | |
let rIndex = Math.floor(array.length * Math.random()); | |
randomizedDeck.push(array[rIndex]); | |
array.splice(rIndex, 1) | |
} |