git clone git@github.com:YOUR-USERNAME/YOUR-FORKED-REPO.git
cd into/cloned/fork-repo
git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git
git fetch upstream
// Adapted from: http://bateru.com/news/2011/11/improved-code-for-javascript-decimal-to-fraction/ | |
function gcd(a, b) { | |
return (b) ? gcd(b, a % b) : a; | |
} | |
var decimalToFraction = function (_decimal) { | |
var top = _decimal.toString().replace(/\d+[.]/, ''); | |
var bottom = Math.pow(10, top.length); | |
if (_decimal > 1) { |
<script src="http://d3js.org/d3.v3.min.js"></script> | |
<script> | |
// takes .mood files from moodbar as input | |
var files = [ | |
"05 - Awolnation - Jump On My Shoulders.mood" | |
]; | |
files.forEach(function(f) { |
<p>Hello | |
<script> | |
var xhr = new XMLHttpRequest(); | |
xhr.open('GET', '/stream'); | |
xhr.seenBytes = 0; | |
xhr.onreadystatechange = function() { | |
console.log("state change.. state: "+ xhr.readyState); |
var scientificToDecimal = function (num) { | |
var nsign = Math.sign(num); | |
//remove the sign | |
num = Math.abs(num); | |
//if the number is in scientific notation remove it | |
if (/\d+\.?\d*e[\+\-]*\d+/i.test(num)) { | |
var zero = '0', | |
parts = String(num).toLowerCase().split('e'), //split into coeff and exponent | |
e = parts.pop(), //store the exponential part | |
l = Math.abs(e), //get the number of zeros |
var webpack = require('webpack') | |
module.exports = function (config) { | |
config.set({ | |
browsers: [ 'Chrome' ], //run in Chrome | |
browserNoActivityTimeout: 60000, | |
singleRun: true, //just run once by default | |
frameworks: [ 'mocha' ], //use the mocha test framework | |
files: [ | |
//'src/**/*.{jsx,js}', |
var fs = require('fs'); | |
var crypto = require('crypto'); | |
fs.readFile('file.pdf', function(err, data) { | |
var checksum = generateChecksum(data); | |
console.log(checksum); | |
}); | |
function generateChecksum(str, algorithm, encoding) { | |
return crypto |