Skip to content

Instantly share code, notes, and snippets.

View hongymagic's full-sized avatar
🤪

David Hong hongymagic

🤪
View GitHub Profile
@hongymagic
hongymagic / UserAgentAPI.js
Created January 15, 2012 12:57
Agent Smith's new storage interface for user-settings
/**
* UserAgent storage object
*
* Use this object to set, get, and delete user agent information
* TODO: sub-type global/tabs/url get/set/delete
*/
var UserAgent = (function (localStorage) {
'use strict';
var
@hongymagic
hongymagic / dabblet.css
Created January 24, 2012 02:48
Simple definition list styling for glossy-rails project
/**
* Simple definition list styling for glossy-rails project
* see: https://github.com/hongymagic/glossy-rails
*/
body { color: #222; font: normal normal 400 100%/140% Arial, sans-serif; background-image: linear-gradient(top, #444, #222); }
dl { margin: 1em auto; padding: 1em; width: 500px; }
dt, dd { margin: 0; padding: 0.2em 25px; background: #222; color: #d5d5d5; }
dd a, dd a:visited { color: #a0a0a0; text-decoration: none; }
@hongymagic
hongymagic / dabblet.css
Created January 24, 2012 06:29
Simple definition list styling for glossy-rails project
/**
* Simple definition list styling for glossy-rails project
* see: https://github.com/hongymagic/glossy-rails
*/
body { color: #222; font: normal normal 400 100%/140% Arial, sans-serif; background-image: linear-gradient(45deg, #444, #222); }
dl { margin: 1em auto; padding: 1em; width: 500px; }
dt, dd { margin: 0; padding: 0.2em 25px; background: #222; color: #d5d5d5; }
dd a, dd a:visited { color: #a0a0a0; text-decoration: none; }
@hongymagic
hongymagic / dabblet.css
Created January 24, 2012 11:16
Simple definition list styling for glossy-rails project
/**
* Simple definition list styling for glossy-rails project
* see: https://github.com/hongymagic/glossy-rails
*/
body { color: #222; font: normal normal 400 200%/140% Arial, sans-serif; background-image: linear-gradient(45deg, #434343, #212121); }
h1, dl { margin: 15px auto; padding: 15px; width: 500px; }
dt, dd { margin: 0; padding: 0 25px; background: #222; color: #d5d5d5; }
dd a, dd a:visited { color: #a0a0a0; text-decoration: none; }
@hongymagic
hongymagic / dabblet.css
Created January 25, 2012 00:44
Simple definition list styling for glossy-rails project
/**
* Simple definition list styling for glossy-rails project
* see: https://github.com/hongymagic/glossy-rails
*/
body { color: #222; font: normal normal 400 100%/140% Arial, sans-serif; background-image: linear-gradient(45deg, #444, #222); }
dl { margin: 1em auto; padding: 1em; width: 500px; position: relative; top: -1000px; }
dt, dd { margin: 0; padding: 0.2em 25px; background: #222; color: #d5d5d5; }
dd a, dd a:visited { color: #a0a0a0; text-decoration: none; }
@hongymagic
hongymagic / go-no-go.sample.config.json
Created February 22, 2012 06:32
A sample configuration file for Go-No-Go game engine
{
"name": "Traffic light craze!",
"engine": "go-no-go",
"sets": 5,
"set": 1,
"assets": {
"loading": {
"background-image": "/assets/go-no-go/traffic/loading.png"
@hongymagic
hongymagic / Pre.js
Created February 23, 2012 03:13
Pre-fetcher, Pre-loader, Pre-fixer, Pre-mium stuff.
/* vim: set noexpandtab tabstop=4 shiftwidth=4 softtabstop=4 autoindent smartindent: */
/* jslint devel: false, browser: true, node: true, eqeq: true, white: true, passfail: true, plusplus: false, regexp: true, maxerr: 50, indent: 4 */
//
// Pre.js 1.0.0
//
// (c) 20011-2012 David Hong, @hongymagic.
// Underscore is freely distributable under the MIT license.
// Portions of Pre.js are inspired or borrowed from Prototype,
// Oliver Steele's Functional, and DocumentCloud's Underscore.js.
@hongymagic
hongymagic / Timer.js
Created March 1, 2012 06:48
A simple timer implementation
// Simple stop watch implementation in JavaScript. Supports functions
// such as:
//
// > `start`, `reset`, `time`, `pause`, `unpause`
//
// See [this demo](https://tinker.io/6154e/3) for information
//
window.Timer = (function () {
@hongymagic
hongymagic / Pre.fix.js
Created March 2, 2012 03:59
Extension to `Pre` client-side JavaScript library to fix vendor prefixes, with usable API to plugin to jQuery, zepto and other libraries.
window.logger = (function (window) {
var document = window.document,
textarea = document.getElementById('log'),
counter = 1;
const DELIMETER = '';
function log () {
var messages = [].slice.call(arguments);
messages.forEach(function (message, index) {
@hongymagic
hongymagic / hon.gy-bookmarklet.js
Created March 5, 2012 10:40
Bookmarklet to shorten URLs with hon.gy!
/* vim: set noexpandtab ts=4 sw=4 ai si: */
(function (window) {
var document = window.document,
body = document.body,
url = document.location,
//
// Watch for ready state change on <script> block, and trigger given
// callback when <script> has been loaded