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
/** | |
Event broadcasting that follows the on / off / trigger pattern | |
@arg obj: optional object to extend with events. NOTE: this event system only listens to events sent with .trigger. | |
dom events will not be listened for. To avoid confusion, you probably shouldn't use this on dom elements. | |
var e = new Events(); | |
e.on("eventname", callbackFunc); // add event listener | |
e.off("eventname", callbackFunc); // rm event listener |
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
/** | |
@HashRouter: Singleton hash router object. | |
// define onroute function | |
HashRouter.onroute = function(hash){} | |
// start the router | |
HashRouter.start(); |
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
define(function (require, exports, module) { | |
/** | |
* | |
* simple stagger function | |
* | |
* TODO: add option for a timing function... will require changing @arg interval to duration | |
* | |
* */ | |
return function (targets, interval, action, delay) { |
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; |
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
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
$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
/* | |
// 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
/** | |
* 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
/* | |
http://x-tags.org/docs | |
usage: | |
const ComponentBase = require('./component-base') | |
xtag.register('x-foo', { | |
prototype: ComponentBase.prototype, |