git clone [email protected]: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
git clone [email protected]: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); |
| /** | |
| * Removes the minus sign from the beginning of the string | |
| * | |
| * @param str | |
| * @returns an array with the first item as true if a minus | |
| * was found and the string minus the minus sign. | |
| */ | |
| function stripSign(str) { | |
| // Check if it has a minus sign | |
| let hasMinus = str.charAt(0) === '-'; |
| 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 |