Skip to content

Instantly share code, notes, and snippets.

Tim Baumann timjb

View GitHub Profile
@timjb
timjb / GithubUser.hs
Created Mar 18, 2019
FTypes JSON example
View GithubUser.hs
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE KindSignatures #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE RecordWildCards #-}
module GithubUser where
import JSONFormat
View resinance.css
/* angepasster CSS-Code von */
/* https://marketpress.de/2019/schriftarten-atomion/ */
body,
button,
select,
optgroup,
textarea {
font-family: mr-eaves-sans, sans-serif;
}
View SizedTrees.agda
module SizedTrees where
open import Agda.Builtin.Size
data list (A : Set₀) : Set₀ where
nil : list A
cons : A list A list A
map : {A B} (A B) list A list B
map f nil = nil
@timjb
timjb / ypassword
Created Jun 10, 2018
YPassword LastPass CSV Export
View ypassword
#!/usr/bin/env zsh
print -- "usage: $0:t"
print -- " generate a password using the ypassword method"
print -- " See http://ypassword.espozito.com for more informations"
passfile="$HOME/.passwd"
echo -n "Enter your master password please: "
oldmodes=$(stty -g)
View offline-delete-min.rs
use std::cmp::Ordering;
struct UnionFindEntry {
parent: usize,
rank: usize,
}
struct UnionFind {
trees: Vec<UnionFindEntry>,
}
View two-universal.hs
module Main where
import Data.List (intercalate)
import Control.Monad (forM_)
type Nat = Int
type Prime = Nat
type HashFunction = Int -> Int
type HashFunctionFamily = Nat -> HashFunction
View README.md

Instructions

This intended to be used together with seafile-docker installed in /var/seafile.

To install:

$ sudo vim /etc/systemd/system/seafile.service # paste the file above
$ sudo systemctl enable /etc/systemd/system/seafile.service
$ sudo systemctl start seafile.service
@timjb
timjb / archimedes.hs
Created Nov 1, 2016
Approximate pi using Archimedes' method
View archimedes.hs
module Main (main) where
import Control.Monad (forM_)
-- | Given the length l of a cord from points A to B on the unit circle, compute
-- the length of the cords A-C and C-B, where C is the point on the unit circle
-- exactly in between A and B.
iterArchimedes :: Double -> Double
iterArchimedes l = l / sqrt (2 + sqrt (4 - l*l))
@timjb
timjb / LICENSE
Last active Oct 22, 2016
Trying to reproduce runtime error with persistent and runMigrationSilent
View LICENSE
Copyright Tim Baumann (c) 2016
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
@timjb
timjb / .gitignore
Last active Aug 9, 2016
Pijul Docker Container
View .gitignore
pijul.org
sanakirja
You can’t perform that action at this time.