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 bash | |
MYCOMMAND='while [ true ]; do sleep 1; echo "beje"; done' | |
# This will take down the whole process tree on ctrl+c | |
trap "exit" INT TERM | |
trap "kill 0" EXIT | |
while true; do | |
sleep 1; |
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
from collections import defaultdict | |
# take 1 | |
def abczzz(limit, abc={3: "fizzz", 5: "buzzz"}): | |
d = defaultdict(str) | |
table = [] | |
for k, v in abc.items(): | |
table += [{k*x:v for x in range(limit)}] | |
for t in table: | |
for k, v in t.items(): |
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
object GameOfLife { | |
type Pos = (Int, Int) | |
type Alive = Boolean | |
type Weight = Int | |
type Grid = Map[Pos, Alive] | |
def findNeighbours(pos: Pos): List[Pos] = { | |
val T = List(-1 , 0, 1) | |
for {x <- T; y <- T if !(x == 0 && y == 0)} yield (x + pos._1, y + pos._2) | |
} |
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 | |
# encoding: utf-8 | |
# Originally developed by Thomas Parslow http://almostobsolete.net | |
# Extended by Urban Skudnik urban.skudnik@gmail.com | |
# | |
# Just a work in progress and adapted to what I need right now. | |
# It does uploads (via a file-like object that you write to) and | |
# I've started on downloads. Needs the development version of Boto from Github. | |
# |
NewerOlder