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
k@del 0 /tmp % { echo "a" > /dev/stdout; echo "b" > /dev/stderr } 1> >(tee -a out) 2> >(tee -a err >&2) | |
b | |
a | |
k@del 0 /tmp % cat out | |
a | |
k@del 0 /tmp % cat err | |
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
# -*- coding: utf-8 -*- | |
#!/usr/bin/env python | |
""" | |
Model for microformat properties and parsers. A microformat parser can | |
parse an HTML element into a dictionary of properties, whose keys are | |
strings and whose values are strings or other dictionary of properties. | |
As an example, the main program of this script parses an hResume from | |
given URL. |
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
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
"""Simple async crawler/callback queue based on gevent.""" | |
import traceback | |
import logging | |
import httplib2 | |
import gevent |
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.Applicative | |
-- | |
-- Utils | |
-- | |
-- Ordered List: difference | |
minus :: (Ord a) => [a] -> [a] -> [a] | |
minus (x:xs) (y:ys) = case (compare x y) of | |
LT -> x : minus xs (y:ys) |
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
--- PKGBUILD 2011-12-17 19:24:25.000000000 -0300 | |
+++ PKGBUILD.new 2012-01-01 14:33:41.501639783 -0300 | |
@@ -22,3 +22,3 @@ | |
source=("http://us.download.nvidia.com/XFree86/Linux-${_arch}/${pkgver}/${_pkg}.run") | |
- md5sums=('29e47c0ba2d755a0807661a988af0773') | |
+ md5sums=('5a80b13f0e92e33367d49866f6377dc1') | |
fi |
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 (untested) implementation of Data.List.groupBy | |
groupBy' :: (a -> a -> Bool) -> [a] -> [[a]] | |
groupBy' f xs = foldr step [] xs | |
where step x acc@(yy@(y:ys):yys) | |
| f x y = (x:yy):yys | |
| otherwise = [x]:acc | |
step x [] = [[x]] |
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
ghci> "Hello World" =~ "W.rld" :: Bool | |
True | |
ghci> "Hello World" =~ "W.rld" :: Int | |
1 | |
ghci> "Hello World" =~ "W.rld" :: String | |
"World" | |
ghci> "Hello World" =~ "W.rld" :: (Int, Int) | |
(6,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
module Tony20 ( | |
Fluffy, | |
furry, | |
EitherLeft(..), | |
EitherRight(..), | |
Misty, | |
banana, | |
unicorn, | |
jellybean, | |
apple |
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
typedef struct { | |
int a; | |
const int b; | |
} thing_t; | |
int main(int argc, char *argv[]) | |
{ | |
thing_t t1 = { .a = 1, .b = 2 }; | |
t1.a = 90; | |
// t1.b = 90; // NO! |
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
- switch (state) { | |
+ switch (state) { /** Finit tillståndsmaskinen från helvete **/ |