I hereby claim:
- I am tylerpaige on github.
- I am tylerpaige (https://keybase.io/tylerpaige) on keybase.
- I have a public key ASAyBwNW8rsyyGyacHHqGLSl0Ha-KTdjz8DlZYQ9hqhyvgo
To claim this, I am signing this object:
/* This function leverages the more cross-browser compatible event `timeupdate` | |
to see if the currentTime value has changed since the media supposedly starting | |
playing. The `timeupdate` event fires ~3/second, so every half second, we check | |
if the currentTime has indeed changed. If it hasn't we trigger a jQuery custom event | |
See this issue on the video.js repo for more information regarding this bug: | |
https://github.com/videojs/video.js/issues/1318 */ | |
function listenForWaiting(media) { | |
var waiting = false; |
/* | |
GETs and POSTs URL parameters | |
handleParam('get', ['key', 'foo']) | |
> { 'key' : 'value', 'foo' : 'bar'} | |
handleParam('post', {'key':'value', 'foo': bar}) | |
*/ | |
function handleParam(method, data){ |
@function stripes($list) { | |
$value : (); | |
@for $i from 1 through length($list) { | |
$color : nth($list, $i); | |
$start : 100% / length($list) * ($i - 1); | |
$end : 100% / length($list) * $i; | |
$rampSegment : $color $start, $color $end; | |
$value : append($value, $rampSegment, comma); | |
} | |
@return linear-gradient($value); |
/* | |
Standardize data set so that variations of a value can be lumped together with the same property value. | |
This function will overwrite properties... Maybe it would be better for it to add a new field. | |
@param data {object} an array of objects that will be sorted | |
@param key {string} the object property to test in every record in the data array | |
@param rules {object} an object of arrays defining which values can be combined | |
@param combineRest {boolean} whether or not to combined records that do not match any rules | |
⤷ if true, all records that do not match a rule will have their property `key` set to `"other"` | |
⤷ if false, all records that do not match a rule will maintain their existing property `key` |
#!/bin/bash | |
# This script will remove every n frames an GIF | |
# Usage: ./frame-count-reduction.sh input.gif n output.gif | |
input=$1 | |
divider=$2 | |
output=$3 | |
numOfFrames=eval gifsicle master.gif -I | grep -E -o "[0-9]+ images" | grep -E -o "[0-9]+" | |
numOfFramesInclusive=$((numOfFrames - 1)) |
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta name="description" content="Valid RGBA checker"> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width"> | |
<title>JS Bin</title> | |
</head> | |
<body> |
I hereby claim:
To claim this, I am signing this object:
const delayedReturn = (i) => { | |
return new Promise((resolve, reject) => { | |
setTimeout(() => { | |
console.log(i); | |
resolve(i); | |
}, 1000); | |
}); | |
}; | |
async function* stepSerial(count) { |
const { promisify } = require('util'); | |
const readFile = promisify(fs.readFile); | |
const lstat = promisify(fs.lstat); | |
const readDir = promisify(fs.readdir); | |
const isDirectory = source => { | |
return lstat(source).then(stats => | |
Promise.resolve(stats.isDirectory() ? source : false) | |
); | |
}; |
const path = require('path') | |
const getAllFiles = (dir, ext = '.js') => { | |
return readDir(dir).then(children => { | |
return children | |
.filter(fileName => { | |
const fileExtension = path.extname(fileName); | |
return fileExtension.includes(ext); | |
}) | |
.map(fileName => path.resolve(dir, fileName)); |