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 mergeObjects (target, source) { | |
var prop; | |
for (prop in source) { | |
if (source.hasOwnProperty(prop)) { | |
if (_.isObject(target[prop]) && _.isObject(source[prop])) { | |
mergeObjects(target[prop], source[prop]); | |
} else { | |
target[prop] = source[prop]; | |
} |
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 () { | |
// Strict mode is not necessary here, it's just used to demonstrate that this works. | |
'use strict'; | |
return (new Function ('return this'))(); | |
})(); |
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
{ | |
"paths": { | |
"text": "path/to/text", | |
"underscore": "empty:", | |
"extra-module": "empty:", | |
"main-module": "main" | |
}, | |
"baseUrl": "./", | |
"out": "out.js", | |
"optimize": "uglify", |
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 backcoloractortxt = rekapi.addActor( | |
new Rekapi.Actor({ | |
'render': function (context, state) { | |
context.beginPath(); | |
var titleheight = 40; | |
context.font = titleheight*state.scale+"px Arial"; | |
context.measureText("Bardon Update").width; | |
var w = context.measureText("HomePrezzo").width; | |
context.font = (titleheight/2)*state.scale+"px Arial"; | |
var w2 = context.measureText("Bardon Update").width; |
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
<!DOCTYPE html> | |
<html> | |
<script src="shifty.js"></script> | |
<script src="date.js"></script> | |
<script> | |
var tweenable = new Tweenable(); | |
tweenable.tween({ | |
from: { 'x': 0 }, |
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 rekapi = new Rekapi(); | |
var textPathActor = rekapi.addActor({ | |
// This actor setup function performs some initial preparation work. This is | |
// where KineticJS is set up and given an initial state. | |
setup: function () { | |
var stage = new Kinetic.Stage({ | |
container: 'container', | |
width: 578, | |
height: 220 | |
}); |
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 rekapi = new Rekapi(document.body); | |
var actor = rekapi.addActor({context: document.getElementById('my-actor')}); | |
// Assumes isMobile is defined somewhere | |
if (isMobile()) { | |
actor | |
.keyframe(0, { | |
transform: 'translateX(0px) translateY(0px)' | |
}) |
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
curl https://raw2.github.com/atebits/Words/master/Words/en.txt | while read line; do say $line; 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
$: rm foo-dir/ | |
rm: cannot remove `foo-dir/': Is a directory | |
$: rm -r foo-dir/ | |
rm: cannot remove `foo-dir': Not a directory |
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 rekapi = new Rekapi(); | |
rekapi.canvasRenderer = new Rekapi.CanvasRenderer(rekapi, document.querySelector('canvas').getContext('2d')); | |
rekapi.domRenderer = new Rekapi.DOMRenderer(rekapi); | |
typeof rekapi.renderer; // 'undefined' |