Skip to content

Instantly share code, notes, and snippets.

View palmerj3's full-sized avatar

Jason Palmer palmerj3

View GitHub Profile
{
"numFailedTestSuites": 0,
"numFailedTests": 0,
"numPassedTestSuites": 2,
"numPassedTests": 2,
"numPendingTestSuites": 0,
"numPendingTests": 0,
"numRuntimeErrorTestSuites": 0,
"numTotalTestSuites": 2,
"numTotalTests": 2,
@palmerj3
palmerj3 / Regenerator
Created March 4, 2017 21:20
Enable async/await in Jest with custom transform. Create a setupFile with this.
require('babel-polyfill');
global.regeneratorRuntime = regeneratorRuntime;
bar
3drotate
51degrees
6brain
ABAValidator
ArcusNode
ClearSilver
DateValidator
DoubleCheck
LDAP
MeCab
var oldRunTaskFn = grunt.util.task.Task.prototype.runTaskFn;
grunt.util.task.Task.prototype.runTaskFn = function () {
var taskName = arguments[0].name
var invokeFn = arguments[1];
var asyncFn = arguments[2];
var start = (new Date()).getTime();
// New Async "Done" function
var newAsyncFn = function () {
fs.appendFileSync('.tmpBuildSteps', [start, (new Date()).getTime(), taskName].join(',') + '\n');
@palmerj3
palmerj3 / gist:8249237
Created January 4, 2014 00:02
A simple example of a timer using requestAnimationFrame
<html>
<head>
</head>
<body>
<h1 id="display"></h1>
<script type="text/javascript">
(function() {
// Source: http://www.paulirish.com/2011/requestanimationframe-for-smart-animating/