The following is a non-exhaustive compendium of HTML5 related scripts, frameworks and templates/boilerplates alongside suggested best practices to be used for any HTML5-type project.
Feel free to add to the list and edit as you see fit.
/usr/bin/spawn-fcgi -a 127.0.0.1 -p 9000 -u www-data -g www-data -f /usr/bin/php5-cgi -P /var/run/fastcgi-php.pid |
// Variable usage: (* marks globals, all other variables are used for various purposes by various parts of the code) | |
// a = calculator | |
// b* = random data | |
// c* = main canvas | |
// d* = main canvas style / main canvas context | |
// e = calculator | |
// f = | |
// g* = main canvas composite operations | |
// h* = 300 (height) | |
// i = counter |
/*! | |
* JavaScript Core Object v0.53 | |
* | |
* Licensed under the new BSD License. | |
* Copyright 2008-2009, Bram Stein | |
* All rights reserved. | |
*/ | |
(function() { | |
function getInternalType(value) { | |
return Object.prototype.toString.apply(value); |
(function($) { | |
$.fn.konami = function(callback, code) { | |
if (code == undefined) code = "38,38,40,40,37,39,37,39,66,65"; | |
return this.each(function() { | |
var kkeys = []; | |
$(this).keydown(function(e) { | |
kkeys.push(e.keyCode); | |
if (kkeys.toString().indexOf(code) >= 0) { |
// Does not work in Safari 5 | |
// Technique one: | |
var lastSheet = document.styleSheets[document.styleSheets.length - 1]; | |
var newName = 'foo'; | |
lastSheet.insertRule("@-webkit-keyframes " + newName + "{ 0% { -webkit-transform: rotateY(0) translate3D(0,0,0); } 25% { -webkit-transform: rotateY(45) translate3D(0,0,-1000px); } 50% { -webkit-transform: rotateY(90) translate3D(0,0,-2500px);} 75% { -webkit-transform: rotateY(135) translate3D(0,0,-1000px);} 100% { -webkit-transform: rotateY(180) translate3D(0,0,0px);} }", lastSheet.cssRules.length); | |
document.getElementById('#foo').style.webkitAnimationName = newName; | |
(function (exports) { | |
if (typeof JSON === "undefined") { | |
throw new Error("JSON is required. Plesae include json2.js if you are running this in the browser"); | |
} | |
var | |
Q = require("promised-io/promise"), | |
HttpClient = require("promised-io/http-client").Client, | |
Trait = require("traits").Trait, | |
base64 = require("./base64"), |
The following is a non-exhaustive compendium of HTML5 related scripts, frameworks and templates/boilerplates alongside suggested best practices to be used for any HTML5-type project.
Feel free to add to the list and edit as you see fit.
/* http://snipplr.com/view.php?codeview&id=47181 */ | |
/* Credit: Jeffrey Way */ | |
.border-radius( @radius: 3px ) { | |
-webkit-border-radius: @radius; | |
-moz-border-radius: @radius; | |
border-radius: @radius; | |
} | |
.outline-radius( @radius: 3px ) { |
var express = require('express') | |
, css = require('stylus') | |
, str = require('fs').readFileSync(__dirname + '/public/css/style.styl', 'utf8'); | |
// What makes sense to me is pass in "str" to be rendered and write that data to the file named "style.css". | |
// But examples show it being named "style.styl" which I thought was already loaded from "str"??? | |
css.render(str, {filename: __dirname + '/public/css/style.css'}, function(err, css){ | |
if (err) throw err; | |
console.log(css); | |
}); |
/** | |
* Module dependencies. | |
*/ | |
var express = require('express') | |
, stylus = require('stylus'); | |
var app = express.createServer(); | |
function compile(str, path) { |