Skip to content

Instantly share code, notes, and snippets.

from requests import get
import xml.etree.ElementTree as ET
import csv
bio = get('https://www.art-trier.de/export/biogutsammelstellen.xml')
biotree = ET.fromstring(bio.content)
with open('bio.csv', 'w') as csvfile:
writer = csv.writer(csvfile, delimiter=';')

Keybase proof

I hereby claim:

  • I am towa on github.
  • I am towa (https://keybase.io/towa) on keybase.
  • I have a public key whose fingerprint is 51CB 73D7 2B90 C782 93C9 A0F1 8602 9810 B124 E138

To claim this, I am signing this object:

@frida-161
frida-161 / c3date.hs
Created December 26, 2017 20:11
calculate congress time
import Data.Time
main = do
today <- getZonedTime
let td = localDay $ zonedTimeToLocalTime today
putStrLn $ getC3date td
getC3date :: Day -> String
getC3date d
| abs (diffDays d d0) > 5 = formatTime defaultTimeLocale "%b %d" d
(ns day6
(:require [clojure.string :as str]
[clojure.core.reducers :as r]))
(defn max_index
"get index of maximum"
[list]
(first (apply max-key second (reverse (map-indexed vector list))))
)
defmodule Jump do
def simple(list) do
do_jump(list, 0, 0, false)
end
def advanced(list) do
do_jump(list, 0, 0, true)
end
@frida-161
frida-161 / 4.sh
Last active December 23, 2017 10:47
#!/bin/bash
while IFS='' read -r line || [[ -n "$line" ]]; do
sorted=""
for l in $line; do
s=$(echo $l | grep -o . | sort |tr -d "\n")
sorted="$sorted $s"
done
echo $sorted
done < "$1"
@frida-161
frida-161 / 3.f90
Last active December 22, 2017 13:21
function add_koords(a, b)
implicit none
type :: koord
sequence
integer :: x, y
end type koord
type (koord) :: a, b, add_koords
@frida-161
frida-161 / 1.pl
Created December 19, 2017 10:09
Advent of Code '17
#!/usr/bin/perl
open (FILEHANDLE, "<input") or die ("Cannot open file.txt");
@n = ();
while (defined($char = getc FILEHANDLE)){
if ( $char != "\n" ) {
push(@n, $char);
}
}
input <- read.table('input')
res1 <- by(input, 1:nrow(input), function(row) {
return(max(row) - min(row))
})
res2 <- by(input, 1:nrow(input), function(row) {
pairs <- combn(row,2, simplify = FALSE)
div_pair <- Find(function(pair){
return(max(pair) %% min(pair) == 0)
}, pairs)

Keybase proof

I hereby claim:

  • I am towarischtsch on github.
  • I am towa (https://keybase.io/towa) on keybase.
  • I have a public key whose fingerprint is 51CB 73D7 2B90 C782 93C9 A0F1 8602 9810 B124 E138

To claim this, I am signing this object: