This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
LazyPromise is a cachey promise creator that returns a function. | |
It's good for lazily running things only once. | |
Promise creation is deferred until the first call. | |
Construct using same signature as a regular Promise (except it doesn't require `new`). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var fs = require('fs') | |
fs.writeFileSync(path.join(__dirname, 'public/styles/_inject.scss'), `$CDN: "${CDN}";`, 'utf8') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// http://x-tags.org/docs | |
const ComponentBase = require('./component-base') | |
xtag.register('x-boilerplate', { | |
prototype: ComponentBase.prototype, | |
lifecycle: { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
http://x-tags.org/docs | |
usage: | |
const ComponentBase = require('./component-base') | |
xtag.register('x-foo', { | |
prototype: ComponentBase.prototype, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* splitText - function to split words into html elements based on words and characters | |
* @param html text to split | |
* @param options optional parameters | |
* @example splitText('some text', { | |
* wordClass: 'word', | |
* charClass: 'char', | |
* chars: true, | |
* }) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
// mapping cues to methods | |
var cuepointMethods = { | |
"1": function(){}, | |
"2.82": function(){}, | |
"3.31": function(){} | |
}; | |
// instantiate with <video>, and an array of cuepoint times => [1, 2.82, 3.31] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$frame.css({ | |
backgroundImage: 'url("' + imgPath + '")', | |
backgroundSize: numFrames*100 + '% ' + '100%' | |
}); | |
var tl = new TimelineMax.to($frame, numFrames/frameRate, { | |
backgroundPosition: -(numFrames-1)*100+ '% 0', | |
ease: SteppedEase.config(numFrames-1), | |
delay: startDelay, | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Shader "Custom/BaseShader" { | |
Properties { | |
_MainTex ("MainTexture", 2D) = "white" {} | |
_PlateTex ("PlateTexture", 2D) = "white" {} | |
} | |
SubShader { | |
Pass{ | |
CGPROGRAM | |
#pragma vertex vert |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
while true ; do | |
clear | |
echo "Press enter to break loop. Script will loop every 3 seconds" | |
echo "If loop freezes press CTRL+C" | |
echo "" | |
echo -e " \033[31mdownloaded\e[0m/\033[32mavailable\e[0m" | |
echo -e " \033[31m"`bitcoind getblockcount 2>&1`"\e[0m"/"\033[32m"`wget -O - http://blockchain.info/q/getblockcount 2>/dev/null`"\e[0m" | |
read -t 3 -n 3 && break | |
done |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function rateLimit(func, time){ | |
var callback = func, | |
waitTimeout, | |
waiting = false, | |
context = this; | |
var rtn = function(){ | |
if(waiting) return; | |
waiting = true; | |
var args = arguments; |