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
#IfWinActive SmoothDraw | |
1::SelectColor(0) | |
2::SelectColor(1) | |
3::SelectColor(2) | |
4::SelectColor(3) | |
5::SelectColor(4) | |
6::SelectColor(5) |
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
rInt :: String -> Int | |
rInt = read | |
count :: String -> Int | |
count [] = 1 | |
count (a:[]) = 1 | |
count (a:b:c) = count (b:c) + twice | |
where | |
twice = if isValid (a:b:[]) then count c else 0 | |
isValid s = (rInt s) < 27 |
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
import Data.List | |
import Data.Maybe | |
type Point = (Int, Int) | |
data Line = Line Point Point | |
deriving (Eq, Show, Ord) | |
fx (Line (n, _) _) = n | |
fy (Line (_, n) _) = n |
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
main() { | |
var a = map(Char, [78, 111, 119, 32, 72, 105, 113, 105, 110, 103, 0]); | |
println(Type(a)); | |
println(a); | |
} | |
> Array[Char, 11] | |
> Now Hiring |
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
procedure fact; | |
overload fact(static 0) = 1; | |
[n | n > 0] | |
overload fact(static n) = fact(static n - 1) * n; | |
main() { | |
var x = fact(static 4); // == 24, calculated at compile time | |
} |
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 == 0) a else gcd(b, a % b); | |
----------------------------------^ | |
main() { | |
############################### | |
rational.clay(2,34): error: type propagation failed due to recursion without base case | |
compilation context: |
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
var titan = titan || {} | |
//===----------------------------------------------------------------------===// | |
// Data | |
//===----------------------------------------------------------------------===// | |
titan.tiles = [ | |
{ name: 'grass' }, | |
]; |
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
import Control.Arrow | |
import Control.Monad | |
import Control.Monad.Random | |
import Data.List | |
import Data.Map | |
import Data.Maybe | |
-- A monad which represents a random integer from 1-6 | |
die :: (RandomGen g) => Rand g Int | |
die = getRandomR (1,6) |
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
DEPS=$(cat urls.txt | grep -o "\w\+\.\w\+$") | |
redo-ifchange $DEPS |
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
var connect = require('connect') | |
, proxy = require('http-proxy') | |
function redirect(loc) { | |
return connect.createServer(function(req, res){ | |
res.writeHead(301, { "Location": loc }); | |
res.end(); | |
}); | |
} |