Skip to content

Instantly share code, notes, and snippets.

View mwinche's full-sized avatar

Matt Winchester mwinche

  • Workfront
  • Utah, United States
View GitHub Profile
@mwinche
mwinche / README.md
Last active February 14, 2019 19:14
Restructure package metadata in subpackages in monorepo

Run via a command like this:

lerna ls -a --loglevel silent | xargs -L1 ./restructure.js
@mwinche
mwinche / fps.js
Last active May 17, 2017 16:34
FPS Logging
fps = ((max_buffer) => {
let lastTime, running, history;
function loop(){
let now = window.performance.now();
history.push(now - lastTime);
lastTime = now;
if(history.length > max_buffer){
history.shift();

Keybase proof

I hereby claim:

  • I am mwinche on github.
  • I am mwinche (https://keybase.io/mwinche) on keybase.
  • I have a public key whose fingerprint is E89D FE32 03D7 A501 129A 89E6 40D7 6B57 C309 B4DA

To claim this, I am signing this object:

@mwinche
mwinche / Cool Things.md
Last active September 19, 2016 14:43
Things that at a quick glance seemed cool and might be useful later
@mwinche
mwinche / README.md
Last active February 21, 2016 23:49
moxios attempt 2

Ideas for moxios

Just some ideas. My original idea was to require everything to be mocked out before the tests run and to throw an exception if they try to hit an unmocked endpoint. However, axios wraps adapters in a promise which delays execution (and therefore knowledge of what is mocked/unmocked) until promise execution time. This caused me to change my approach.

Now the idea is that you call a specific resolve method. This method will then work against all intercepted requests and all mocked paths trying to resolve requests in submission order. If they passed true into

@mwinche
mwinche / cli.js
Last active December 6, 2015 00:42
xmas-names
#!/usr/bin/env node
//Reads a list of unique names from stdin then when the stream is closed,
//Prints the assignments to stdout
var es = require('event-stream');
var random = require('random-item-in-array');
var names = {};
@mwinche
mwinche / npm-debug.log
Created September 2, 2015 16:43
npm install handlebars@4.0.0 on npm 3.3.0
0 info it worked if it ends with ok
1 verbose cli [ 'node', '/usr/local/bin/npm', 'i', 'handlebars@4.0.0' ]
2 info using npm@3.3.0
3 info using node@v0.12.2
4 verbose node symlink /usr/local/bin/node
5 silly loadCurrentTree Starting
6 silly install loadCurrentTree
7 silly install readLocalPackageData
8 silly fetchPackageMetaData handlebars@4.0.0
9 silly fetchNamedPackageData handlebars
@mwinche
mwinche / index.js
Last active August 29, 2015 14:21
Initial file contents for training
//colors must be required use .yellow, .bold, etc. on strings
require('colors');
//Dependencies
var words = require('in-words').en;
var calc = require('training-calculator');
//If this was called directory, calculate the result
if(require.main === module){
var args = process.argv.slice(2);
@mwinche
mwinche / chain-cli.js
Created August 4, 2014 03:04
Idea I was playing with for using Gulp plugins to compile and serve assets on the fly
#!/usr/bin/env node
var less = require('gulp-less'),
express = require('express'),
gulp = require('gulp');
var app = express();
app.get('/test.css', function(req, res){
gulp.src('test.less')