Skip to content

Instantly share code, notes, and snippets.

View island205's full-sized avatar
🎯
Focusing

Zhi Cun island205

🎯
Focusing
View GitHub Profile
class Vector2
x: 0
y: 0
constructor:() ->
constructor:(@x, @y) ->
constructor:(vector) ->
x = vector.x
(function() {
var HanHan, HanJiaJun;
var __hasProp = Object.prototype.hasOwnProperty, __extends = function(child, parent) {
for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; }
function ctor() { this.constructor = child; }
ctor.prototype = parent.prototype;
child.prototype = new ctor;
child.__super__ = parent.prototype;
return child;
};
class HanJiaJun
###
相当于JS中的构造函数
###
constructor:(@name)->
console.log "I am HanJiaJun!"
###
原型方法
###
write:(title)->
@island205
island205 / dabblet.css
Created December 16, 2011 08:00
The first commented line is your dabblet’s title
/**
* The first commented line is your dabblet’s title
*/
background: #f06;
background: linear-gradient(45deg, #f06, yellow);
min-height:100%;
@island205
island205 / critique.md
Created December 5, 2011 02:05 — forked from Raynos/critique.md
jQuery library critique

jQuery

$ itself is a god object. Everything goes on it. The standard plugin / extension architecture that is recommended is to just bolt more methods on $ itself!

Surely this is bad. An example would be how we have both $.load which is overloaded to do completely different things. If they were on two separate sensibly named objects $Container.load and $EventTarget.load. Personally I would deprecate the latter in favour of .on('load'

The animation should be it's own little modular thing, not bolted onto $. Ajax should be it's own little modular thing, not bolted onto $

$