Skip to content

Instantly share code, notes, and snippets.

View goofmint's full-sized avatar

Atsushi goofmint

View GitHub Profile
@goofmint
goofmint / gist:1674447
Created January 25, 2012 03:10
Arctic.js class extends
var Employee = arc.Class.create(Person, {
_division:null,
initialize:function(name, division) {
this._division = division;
},
getDivision:function() {
return this._division;
}
@goofmint
goofmint / gist:1674448
Created January 25, 2012 03:11
Arctic.js super method
var Friend = arc.Class.create(Person, {
_nickname:null,
initialize:function(name) {
this.setName(name);
},
setName: function($super, name, nickname){
$super(name);
this._nickname = nickname;
@goofmint
goofmint / gist:1674491
Created January 25, 2012 03:16
Font.js load TTF
function load_ttf(button) {
button.disabled = "disabled";
// let's load a font!
var font = new Font();
// set up the onload handler
font.onload = function() {
// create a paragraph of text, styled with this font, showing all metrics
var p = document.getElementById("fontinfo_ttf");
@goofmint
goofmint / gist:1674500
Created January 25, 2012 03:17
Font.js load OTF
function load_otf(button) {
button.disabled = "disabled";
// let's load a font!
var font = new Font();
// set up the onload handler
font.onload = function() {
// create a paragraph of text, styled with this font, showing all metrics
var p = document.getElementById("fontinfo_otf");
@goofmint
goofmint / dabblet.css
Created February 8, 2012 06:55
The first commented line is your dabblet’s title
/**
* The first commented line is your dabblet’s title
*/
background: #f66;
background: linear-gradient(45deg, #f06, yellow);
min-height:100%;
@goofmint
goofmint / gist:1785289
Created February 10, 2012 01:38
Auto count on favicon.
(function(){
var count = 0;
setInterval(function(){
if (++count > 99) count = 0;
Tinycon.setBubble(count);
}, 1000);
})();
@goofmint
goofmint / gist:1785426
Created February 10, 2012 01:54
Easy book basic template
book:
title: "'Open source for Business'"
author: "Change this: Author Name"
edition: "First edition"
language: en
publication_date: ~
generator: { name: easybook, version: 4.0 }
contents:
@goofmint
goofmint / gist:1822486
Created February 14, 2012 02:05
difflet demo 1
var difflet = require('../');
var s = difflet.compare({ a : 2, c : 5 }, { a : 3, b : 4 });
process.stdout.write(s);
@goofmint
goofmint / gist:1822490
Created February 14, 2012 02:06
difflet demo 2
var diff = require('../')({ indent : 2 });
var prev = {
yy : 6,
zz : 5,
a : [1,2,3],
fn : 'beep',
c : { x : 7, z : 3 }
};
@goofmint
goofmint / gist:1822491
Created February 14, 2012 02:06
difflet 3 demo
var difflet = require('../');
var ent = require('ent');
var tags = {
inserted : '<span class="g">',
updated : '<span class="b">',
deleted : '<span class="r">',
};
var diff = difflet({
start : function (t, s) {