Skip to content

Instantly share code, notes, and snippets.

View hongymagic's full-sized avatar
🤪

David Hong hongymagic

🤪
View GitHub Profile
@hongymagic
hongymagic / dabblet.css
Created March 9, 2012 03:27
Gems gems gems gems gems gems gems
/**
* Gems gems gems gems gems gems gems
*/
.gem { display: block; padding-left: 90px; line-height: 80px; font-size: 70px; font-family: Helvetica, Arial, sans-serif; }
.gem.gem-green { background: transparent url(http://images4.wikia.nocookie.net/__cb20100522145657/ztreasureisle/images/7/75/Green_Gem-icon.png) top left no-repeat; }
.gem.gem-red { background: transparent url(http://images4.wikia.nocookie.net/__cb20100522145543/ztreasureisle/images/a/af/Red_Gem-icon.png) top left no-repeat; }
@hongymagic
hongymagic / say [a-zA-Z].sh
Created March 12, 2012 03:11
Generate wav files of Mac voices spelling out the alphabet
#!/bin/zsh
local IFS=$'\n'
for voice in `say -v '?' | cut -c1-20 | sed 's/ *$//g' | tr '[A-Z]' '[a-z]'`
do
for alphabet in `perl -le 'do { print $_ } foreach (a..z);'`
do
if [ ! -d ${voice} ]
then
@hongymagic
hongymagic / sessions.json
Created March 27, 2012 02:50
Go-no-go configuration data
{
"id": 1024,
"name": "Midsomer Murders",
"engine": "Go-No-Go",
"description": "Exercise your working memory",
"assets": {
"screen": {
"background-image": "http://placehold.it/800x600"
@hongymagic
hongymagic / dabblet.css
Created April 3, 2012 22:52
ABC Brain Fit Login box
/**
* ABC Brain Fit Login box
*/
h1, h2, h3, h4, h4, p { margin: 0; padding: 0; }
html, body {
background: #004164;
background: linear-gradient(top, #003f61, #004164);
@hongymagic
hongymagic / dabblet.css
Created April 3, 2012 23:53
ABC Brain Fit Login box
/**
* ABC Brain Fit Login box
*/
h1, h2, h3, h4, h4, p { margin: 0; padding: 0; }
html, body {
background: #004164;
background: linear-gradient(top, #003f61, #004164);
@hongymagic
hongymagic / game.state.js
Created April 11, 2012 07:17
Sample game state management
var GameState = function (ctx) {
this.ctx = ctx;
};
GameState.prototype = {
init: function (timestamp) {
this.start = timestamp;
},
draw: function (timestamp) {
@hongymagic
hongymagic / dabblet.css
Created April 12, 2012 01:57
Game icon for ABC Brainfit
/**
* Game icon for ABC Brainfit
*/
.game,.game.locked::after,.game h4 {
display:block;
margin:0;
box-sizing:border-box
}
@hongymagic
hongymagic / dabblet.css
Created April 12, 2012 01:56
Game icon
/**
* Game icon
*/
.game {
display: block;
margin: 0; padding: 0;
width: 100px; height: 100px;
position: relative;
@hongymagic
hongymagic / tempted.js
Created May 14, 2012 04:31
Simple client-side only, data-less templating. Dependency on jQuery
// Very simple client-side only, data-less, templating system.
//
// Usage:
// <div data-view="footer" data-type="partial"></div>
// <div data-view="article" data-type="view"></div>
var tempted = function (context) {
if (!context) {
context = window.document;
}
@hongymagic
hongymagic / mask.js
Created June 3, 2012 06:22 — forked from bjouhier/hackGlobal.js
Masking eval, extracting FunctionBody – not really sure where it would be used.
// Extract FunctionBody as eval expects FunctionBody
Function.prototype.getBody = function() {
var m = this.toString().match(/\{([\s\S]*)\}/m)[1];
return m.replace(/^\s*\/\/.*$/mg,'');
};
var GLOBAL = "GLOBAL";
function foo () {