This file contains hidden or 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
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE | |
Version 2, December 2004 | |
Copyright (C) 2011 YOUR_NAME_HERE <YOUR_URL_HERE> | |
Everyone is permitted to copy and distribute verbatim or modified | |
copies of this license document, and changing it is allowed as long | |
as the name is changed. | |
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE |
This file contains hidden or 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
Person = -> | |
return | |
Person::hello = -> alert "hello" | |
John = -> | |
Person.call @ | |
return | |
John::__proto__ = Person:: # This is shorter, but changing __proto__ is deprecated | |
# John:: = __proto__: Person::, constructor: John # this would be equivalent to the former line, but is longer! | |
John::hello = -> alert "ciao" |
This file contains hidden or 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
Transducer = | |
employ: (x)-> x.call @ | |
# Privitive transducers | |
map: (f)-> (conj)-> (a,b)-> conj(f(a), b) | |
mapcat: (f)-> (conj)-> (a,b)-> f(conj)(a, b) | |
filter: (f)-> (conj)-> (a,b)-> if f(a) then conj(a,b) else b | |
# Operator for binary composition of transducers | |
comp2: (a,b)-> (conj)-> a(b(conj)) |
This file contains hidden or 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
ignoreEvent = (event)-> | |
event.preventDefault() | |
event.stopPropagation() | |
true | |
$('select[multiple]').each -> | |
select = $ @ | |
values = {} | |
$('option',select) | |
.each (i, option)-> | |
values[option.value] = !!option.selected |
This file contains hidden or 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
hsv2rgb = ([h,s,v])-> | |
return [v,v,v] if s is 0 | |
h = if h >= 1 then h - 1 else h | |
hh = h * 6 | |
hhh = Math.floor hh | |
f = hh - hhh | |
a = v * (1.0 - s) | |
b = v * (1.0 - s * f) | |
c = v * (1.0 - s * (1 - f)) | |
return switch hhh |
This file contains hidden or 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
--- git-2.0~next.20140207.orig/dir.c | |
+++ git-2.0~next.20140207/dir.c | |
@@ -1589,7 +1589,7 @@ void setup_standard_excludes(struct dir_ | |
const char *path; | |
char *xdg_path; | |
- dir->exclude_per_dir = ".gitignore"; | |
+ dir->exclude_per_dir = ignore_per_dir; | |
path = git_path("info/exclude"); | |
if (!excludes_file) { |
This file contains hidden or 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
"@"+("00"+Math.floor((((x.getUTCHours()+1)%24*60+x.getUTCMinutes())*60+x.getUTCSeconds()+(x.getUTCMilliseconds()*0.001))/86.4)).slice(-3) |
This file contains hidden or 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
// Converts key from plain hexadecimal to inverted-byte hexadecimal | |
function hex2ibh(x) { | |
x = new Array(64 + 1 - x.length).join("0") + x; // Pad with '0' at the front | |
// Invert bytes | |
return x.split(/(..)/).reverse().join(""); | |
} | |
function ibh2hex(x) { | |
//assert(length(x) == 64); | |
// Invert bytes |
This file contains hidden or 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
# Copyright (c) 2013 Michele Bini; MIT license | |
ace = window.ace ? window.__ace_shadowed__ | |
if require = ace?.require | |
require ["ace/layer/text"], ({Text}) -> | |
orig = Text.prototype.$renderToken | |
patched = do ( | |
rgx = new RegExp "[a-z][0-9]*[A-Z]", "g" | |
) -> (builder, col, token, value) -> | |
if match = rgx.exec value |