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
window.addEvent('keydown', (function (k) { | |
var a = k[k[0]](), b = k[k[a]()](), s = k.slice(0); | |
return function(e) { | |
e.key == s[a]() && (s[b] || obfuscato()) || (s = k.slice(0)); | |
}; | |
}("shift,pop,up,up,down,down,left,right,left,right,b,a,length".split(',')))); |
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
(define (make-captcha text filename width height) | |
(let* ((img (car (gimp-image-new width height RGB))) | |
(bg (car (gimp-layer-new img width height RGBA-IMAGE "bg" 100 NORMAL-MODE))) | |
(noise-layer (car (gimp-layer-new img width height RGBA-IMAGE "noise" 100 NORMAL-MODE))) | |
(text-layer (car (gimp-text-fontname img -1 30 50 text 0 TRUE 60 PIXELS "FreeMono Bold")))) | |
(gimp-display-new img) | |
(gimp-image-add-layer img bg 0) | |
(gimp-image-lower-layer-to-bottom img bg) |
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
<!DOCTYPE xsl:Stylesheet [ <!ENTITY nbsp " "> ]> | |
<xsl:stylesheet | |
version="1.0" | |
xmlns:xsl="http://www.w3.org/1999/XSL/Transform" | |
xmlns:msxml="urn:schemas-microsoft-com:xslt" | |
xmlns:umbraco.library="urn:umbraco.library" | |
xmlns:media="http://search.yahoo.com/mrss" | |
exclude-result-prefixes="msxml umbraco.library media"> | |
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
#lang scheme | |
(require (planet bzlib/http:1:0) | |
(planet dherman/json:3:0) | |
web-server/servlet | |
web-server/servlet-env) | |
(define (redirect? response) | |
(let ([code (http-client-response-code response)]) | |
(<= 300 code 306))) |
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
// Javascript | |
function triangle(a,b) { | |
if(a > 0 && b > 0 ) { | |
function sqroot(x) { | |
return (x > 0) ? Math.pow(x,.5) : 0; | |
} | |
return sqroot( a*a + b*b ); | |
} else return 0; | |
} |
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
(let* ((yin | |
((lambda (cc) (display #\@) cc) (call-with-current-continuation (lambda (c) c)))) | |
(yang | |
((lambda (cc) (display #\*) cc) (call-with-current-continuation (lambda (c) c)))) ) | |
(yin yang)) |
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
function plus(a, b) { return a + b; } | |
Seq.iter(1, curry(plus, 1)) | |
// the series of all positive integers | |
Seq.iter(1, 1, plus) // the fibonacci series | |
Seq.repeat(1) // 1, 1, 1, 1, ... | |
Seq.cycle(1, 2, 3) // 1, 2, 3, 1, 2, 3, 1, 2, ... |
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
integers.filter(even) // 2, 4, 6, ... |
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
integers.reduce(plus, 0) | |
// throws "InfiniteStream cannot be reduced" |
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
Basic Usage | |
----------- | |
Twitter.View is a class that monitors any number of twitter timelines. | |
The option 'feeds' can take a string or an array of strings. | |
It understands a shorthand for users "@user", lists "@user/list", and everything else becomes a search. | |
This example will follow the user "sharkbrain", a list he owns called "my-friends" and search for any posts directed to him. | |
var sharkView = new Twitter.View({'feeds': ['@sharkbrain', '@sharkbrain/my-friends', 'to:sharkbrain']}); |
OlderNewer