Skip to content

Instantly share code, notes, and snippets.

View ebhoren's full-sized avatar

Dominic Mercier ebhoren

View GitHub Profile
@ebhoren
ebhoren / assets-campground.js
Last active August 29, 2015 13:56
Grunt file for generating assets from Campground
/*global module:false*/
module.exports = function(grunt) {
// load all grunt tasks
require('matchdep').filterDev('grunt-*').forEach(grunt.loadNpmTasks);
// Project configuration.
grunt.initConfig({
config: {
@ebhoren
ebhoren / cuepoints.json
Created February 21, 2014 15:57
CuePoints
{
"cuePoints": [{ "name": "skip", "time": 21 }, { "name": "start", "time": 23 }, { "name": "end", "time": 30 }]
}
@ebhoren
ebhoren / cuepoints.as
Created February 21, 2014 16:04
CuePoints event trigger
var n:int = _$cuePoints.length,
time:Number = _$videoLoader.time,
cuePoint:Object;
while( --n >= 0 )
{
cuePoint = _$cuePoints[n];
if( cuePoint.time > time ) continue;
if( n === _$cuePointsIndex ) break;
@ebhoren
ebhoren / i18n.json
Created February 24, 2014 16:16
Internationalization files on fortmcmoney.com
{
"character-cancel-come-back-later": "Come back later",
"character-cancel-talk-later": "Talk later",
"dashboard-open": "Open my dashboard",
"screen-turn-off": "Turn off TV"
}
@ebhoren
ebhoren / node-spritesheet
Created March 13, 2014 15:40
node-spritesheet installation error
0 info it worked if it ends with ok
1 verbose cli [ 'node',
1 verbose cli '/usr/local/bin/npm',
1 verbose cli 'install',
1 verbose cli 'node-spritesheet',
1 verbose cli '--save-dev' ]
2 info using [email protected]
3 info using [email protected]
4 verbose readDependencies using package.json deps
5 verbose cache add [ 'node-spritesheet', null ]
@ebhoren
ebhoren / cdb-ribbons1.js
Last active August 29, 2015 14:07
Comme des bêtes- Ribbons animation 1
var canvas = document.getElementById('canvas'),
source = document.createElement('canvas'),
width = window.innerWidth,
height = window.innerHeight,
context = canvas.getContext('2d'),
path1x = 0.0,
path2x = 0.0;
@ebhoren
ebhoren / cdb-ribbons2.js
Last active August 29, 2015 14:07
Comme des bêtes - Ribbons animation 2
// script start here
var canvas = document.getElementById('canvas'),
source = document.createElement('canvas'),
width = window.innerWidth,
height = window.innerHeight,
context = canvas.getContext('2d'),
path1x = 0.0,
path2x = -0.1;
@ebhoren
ebhoren / gist:e62e6d23c7c0f3472846c44512fd7d21
Created September 15, 2017 18:19
A-Frame curved image formula
aspect = image width / image height
height = (2 * Math.PI * radius * theta-length) / (360 * aspect)
@ebhoren
ebhoren / aframe-spritesheet.js
Created October 10, 2017 01:36
aframe-spritesheet component
/**
* A-Frame Spritesheet Component for A-Frame.
* Enables dynamic control of animation spritesheets
*/
AFRAME.registerComponent('sprite-sheet', {
schema: {
progress: { type: 'number', default: 0 },
frameName: { type: 'string', default: null },
firstFrame: { type: 'number', default: 0 },
lastFrame: { type: 'number', default: null },
@ebhoren
ebhoren / table-responsive.css
Created June 19, 2018 14:26
Basic css to create a responsive table.
table.table-a11y {
display: block;
}
table.table-a11y thead,
table.table-a11y tbody,
table.table-a11y tfoot {
display: block;
}