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
gcd = (a,b) -> if b then gcd b, a%b else a | |
mcm = (a,b) -> a*b / gcd(a,b) |
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
gcd={a,b->b?gcd(b,a%b):a} | |
mcm={a,b->a*b/gcd(a,b)} |
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 = 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 |
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
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 '' |
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
gcd(a,b) | |
unless b | |
return a | |
gcd(b, a%b) | |
mcm(a,b) | |
a*b / gcd(a,b) |
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
// 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 || \ |
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
/* 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); |
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
<!-- 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 --> |
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
# 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 |
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
/** | |
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