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
### constants ### | |
NAME = name_of_program | |
# directories | |
SRC_DIR = src | |
INCLUDE_DIR = include | |
BUILD_DIR = build | |
TARGET_DIR = $(BUILD_DIR)/debug | |
RELEASE_TARGET_DIR = $(BUILD_DIR)/release |
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 | |
"""The script replaces colors contained in output from | |
`curl -s wttr.in/$Location` with conky-compatible color codes. | |
Use it like this: | |
``` | |
conky.text = [[ | |
${execpi 1800 curl -s wttr.in/Hamburg | head -7 | tail -5 | /path/to/run.py} | |
]] | |
``` |
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
#!/bin/bash | |
day=`date +"%a"` | |
case "$day" in | |
Mon) | |
echo "Italian B.M.T." | |
;; | |
Tue) |
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 runhaskell | |
{- | |
0 1 2 3 4 5 6 7 | |
0 □ ■ □ ■ □ ■ □ ■ | |
1 ■ □ ■ □ ■ □ ■ □ | |
2 □ ■ □ ■ □ ■ □ ■ | |
3 ■ □ ■ □ ■ □ ■ □ | |
4 □ ■ □ ■ □ ■ □ ■ | |
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
data Tree a = Empty | Leaf a | Tree a (Tree a) (Tree a) deriving Show | |
treeInsert :: Ord a => a -> Tree a -> Tree a | |
treeInsert n Empty = Leaf n | |
treeInsert n (Leaf m) | |
| n <= m = Tree m (Leaf n) Empty | |
| n > m = Tree n (Leaf m) Empty | |
treeInsert n (Tree v left right) | |
| n == v = Tree n left right |
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
data List a = Empty | Cons a (List a) | |
instance (Show a) => Show (List a) where | |
show xs = "<" ++ show' xs ++ ">" | |
where | |
show' Empty = "" | |
show' (Cons x Empty) = show x | |
show' (Cons x xs) = show x ++ "," ++ show' xs | |
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
reverse' :: [a] -> [a] | |
reverse' [] = [] | |
reverse' xs = (last xs) : (reverse' $ init xs) | |
sort' :: Ord a => [a] -> [a] | |
sort' [] = [] | |
sort' (pivot:xs) = | |
sort' [x | x <- xs, x < pivot] | |
++ [pivot] |
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
#!/bin/bash | |
gcc -o click click.c -lX11 -lXtst -O2 -flto -march=native -mtune=native -DDELAY_SECONDS=0 -DDELAY_NSECONDS=35000000 |