Skip to content

Instantly share code, notes, and snippets.

View gerardpaapu's full-sized avatar
🏠
Working from home

Gerard Paapu gerardpaapu

🏠
Working from home
View GitHub Profile
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(','))));
(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)
<!DOCTYPE xsl:Stylesheet [ <!ENTITY nbsp "&#x00A0;"> ]>
<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">
#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)))
// 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;
}
(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))
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, ...
integers.filter(even) // 2, 4, 6, ...
integers.reduce(plus, 0)
// throws "InfiniteStream cannot be reduced"
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']});