View gcd.coffee
gcd = (a,b) -> if b then gcd b, a%b else a | |
mcm = (a,b) -> a*b / gcd(a,b) |
View gcd.groovy
gcd={a,b->b?gcd(b,a%b):a} | |
mcm={a,b->a*b/gcd(a,b)} |
View proxy.coffee
http = require 'http' | |
util = require 'util' | |
url = require 'url' | |
server = http.createServer (req, res) -> | |
request = url.parse req.url | |
request.headers = req.headers | |
request.method = req.method |
View clear.py
class clear: | |
def __call__(self): | |
import os | |
if os.name==('ce','nt','dos'): os.system('cls') | |
elif os.name=='posix': os.system('clear') | |
else: print('\n'*120) | |
def __neg__(self): self() | |
def __repr__(self): | |
self();return '' |
View gcd.styl
gcd(a,b) | |
unless b | |
return a | |
gcd(b, a%b) | |
mcm(a,b) | |
a*b / gcd(a,b) |
View the-macro.c
// My artistic composition is able to compare | |
// two versions in a single expression! YAY! | |
#define FOO_AVAILABLE(major, \ | |
minor, \ | |
patch) \ | |
\ | |
( FOO_MAJOR_VERSION >major || \ | |
( FOO_MAJOR_VERSION==major && \ | |
\ | |
( FOO_MINOR_VERSION >minor || \ |
View dabblet.css
/* Inner text shadow */ | |
@import url(http://fonts.googleapis.com/css?family=Open+Sans+Condensed:300,700,300italic); | |
h1 { | |
font: bold 6em 'open sans condensed'; | |
text-align: center; | |
/** This is where the magic happens **/ | |
background-color: rgba(204,129,0,.9); |
View tour.html
<!-- the slides --> | |
<div id="slides"> | |
<div class="slide"> | |
<!-- Content of slide #1 --> | |
</div> | |
<div class="slide"> | |
<!-- Content of slide #2 --> | |
</div> | |
<div class="slide"> | |
<!-- Content of slide #3 --> |
View is-it-next-to.py
# Returns `True` if the square at `a` is in one of the | |
# **eight surrounding squares** of `b`; `False` otherwise. | |
def nextTo(a, b): | |
x = a[0] - b[0] | |
y = a[1] - b[1] | |
d = x*x + y*y | |
return 0 < d < 3 |
View dabblet.css
/** | |
Shadow effects | |
============== | |
Multiple text-shadows can be stacked to | |
create wonderful, realistic effects. | |
Oh, and CSS allows for expressiveness too. | |
Try zooming in and disabling some shadows! | |
OlderNewer