This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var Base = class_({ | |
_init: function(a, b) { | |
this.a = a; | |
this.b = b; | |
}, | |
someMethod: function(a) { | |
this.a = a; | |
}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<!-- | |
Author: Ma Jiehong <ma.jiehong@gmail.com> | |
Copyright (C) 2010 Ma Jiehong | |
This library is free software; you can redistribute it and/or | |
modify it under the terms of the GNU Library General Public | |
License as published by the Free Software Foundation; either | |
version 2 of the License, or (at your option) any later version. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// How to make JQuery-like function in Java | |
// shamansir.github.com (c) | |
public interface ProvidesElements { | |
public Elements[] get(); | |
} | |
public class JQ implements ProvidesElements { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// === PATHS =================================================================== | |
// M<X> <Y> - move to | |
// L<X> <Y> - line to | |
// C<X1> <Y1> <X2> <Y2> <X3> <Y3> - curve to | |
// Z - close path | |
// lowercase marker means relative coord | |
// Example: "M0 10 L20 20 C10 20 15 30 10 9 Z" | |
// all commands: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* See also: http://cl.ly/0Q1n1P0R223E1224332M/o */ | |
/* the main trick */ | |
function deferrable(f) { | |
return function() { | |
return (function(f, args) { | |
return function() { | |
return f.apply(null, args); | |
}; | |
})(f, arguments); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// http://jsfiddle.net/shaman_sir/SFHuV/7/ | |
function offset(elm) { | |
var curleft = 0, | |
curtop = 0; | |
do { | |
curleft += elm.offsetLeft; | |
curtop += elm.offsetTop; | |
} while (elm && (elm = elm.offsetParent)); | |
return [ curleft, curtop ]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Excerpt from: https://github.com/Animatron/player/blob/master/anm.collisions.js | |
function edgeTest(p1, p2, p3, r2) { | |
var rot = [ -(p2[1] - p1[1]), | |
p2[0] - p1[0] ]; | |
var ref = (rot[0] * (p3[0] - p1[0]) + | |
rot[1] * (p3[1] - p1[1])) >= 0; | |
for (var i = 0, il = r2.length; i < il; i+=2) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$p-base03: #002b36 | |
$p-base02: #073642 | |
$p-base01: #586e75 | |
$p-base00: #657b83 | |
$p-base0: #839496 | |
$p-base1: #93a1a1 | |
$p-base2: #eee8d5 | |
$p-base3: #fdf6e3 | |
$p-yellow: #b58900 | |
$p-orange: #cb4b16 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* source: https://github.com/larrymyers/jasmine-reporters */ | |
/* The MIT License | |
Copyright (c) 2010 Larry Myers | |
Permission is hereby granted, free of charge, to any person obtaining a copy | |
of this software and associated documentation files (the "Software"), to deal | |
in the Software without restriction, including without limitation the rights | |
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
OlderNewer