Skip to content

Instantly share code, notes, and snippets.

View yoshuawuyts's full-sized avatar

Yosh yoshuawuyts

View GitHub Profile
npm git/master*
❯ npm i -g npm

Installing npm
[||||||||            ] 40%

0.0.4 ✔ builtins
0.0.0 ✔ https-browserify
0.0.0 ✔ path-browserify
#!/usr/bin/env node
/**
* Module dependencies
*/
var spawn = require('child_process').spawn;
var program = require('commander');
var fs = require('fs');
@yoshuawuyts
yoshuawuyts / fluxRouter.js
Created June 12, 2014 15:47
Snapshot of what my react.js flux compliant router looks like. Using react-router-component for the routing. Requires to be passed an initial 'window.location' prop to initialize. Using 'barracks' and 'dad' for the dispatcher and store respectively.
/* global window*/
/**
* Module dependencies
*/
var router = require('react-router-component');
var debug = require('debug')('versity:router');
var react = require('react');
var settings = require('../../views/settings/settings');
{
"color_scheme": "Packages/Tomorrow Color Schemes/Tomorrow.tmTheme",
"font_size": 10,
"ignored_packages":
[
"Vintage"
],
"rulers":
[
80
/**
* Functions
*/
var x = function(arg1, arg2) {
return arg1 * arg2;
};
var x = (arg1, arg2) => arg1 * arg2;
function arraysIdentical(a, b) {
var i = a.length;
if (i != b.length) return false;
while (i--) if (a[i] !== b[i]) return false;
return true;
};
function arraysIdentical(a, b) {
var i = a.length;
if (i !== b.length) {
return false;
}
while (i--) {
if (a[i] !== b[i]) {
return false;
}
}
function arraysIdentical(a, b) {
var i = a.length;
if (i !== b.length) return false;
while (i--) {
if (a[i] !== b[i]) return false;
}
return true;
}
// Internal recursive comparison function for `isEqual`.
var eq = function(a, b, aStack, bStack) {
// Identical objects are equal. `0 === -0`, but they aren't identical.
// See the [Harmony `egal` proposal](http://wiki.ecmascript.org/doku.php?id=harmony:egal).
if (a === b) return a !== 0 || 1 / a === 1 / b;
// A strict comparison is necessary because `null == undefined`.
if (a == null || b == null) return a === b;
// Unwrap any wrapped objects.
if (a instanceof _) a = a._wrapped;
if (b instanceof _) b = b._wrapped;
(function() {
var waveMaxRadius = 150;
//
// INK EQUATIONS
//
function waveRadiusFn(touchDownMs, touchUpMs, anim) {
// Convert from ms to s.
var touchDown = touchDownMs / 1000;