Skip to content

Instantly share code, notes, and snippets.

View freddie-freeloader's full-sized avatar

Jonas Benn freddie-freeloader

  • Berlin
View GitHub Profile
# Edit this configuration file to define what should be installed on your system. Help is available in the configuration.nix(5) man page and in the NixOS manual (accessible by running ‘nixos-help’).
{ config, pkgs, ... }:
{
imports = [ # Include the results of the hardware scan.
./hardware-configuration.nix
./ssd-configuration.nix
./users.nix <home-manager/nixos>
];
@freddie-freeloader
freddie-freeloader / starman_boring.hs
Last active November 14, 2018 21:51 — forked from jtomchak/starman.hs
Starman, version of hangman, in Haskell on the command line
main :: IO ()
main = do
starman "covfefe" 10
putStrLn "Program now shuts down"
--starman super game
starman :: String -> Int -> IO ()
starman word n = turn word ['-' | x <- word] n
@freddie-freeloader
freddie-freeloader / gist:cae528b35f31ef076251bc86f5f16ced
Created July 4, 2018 13:06 — forked from sebfisch/gist:2235780
Laymans explanation of delimited continuations with examples of using them for exception handling and nondeterministic programming.

Delimited Continuations

Delimited continuations manipulate the control flow of programs. Similar to control structures like conditionals or loops they allow to deviate from a sequential flow of control.

We use exception handling as another example for control flow manipulation and later show how to implement it using delimited continuations. Finally, we show that nondeterminism can also be expressed using delimited continuations.

Exception Handling

@freddie-freeloader
freddie-freeloader / moodle_pointscraper.py
Created July 17, 2017 15:56
Not at all finished moodle point scraper
import pandas as pd
import argparse
# Example: printStuff('blub.html')
# Where 'blub.html' is downloaded from Moodle
def printStuff(fileName):
table = pd.read_html(fileName)[0]
res = table[1:-2][['Bereich', 'Prozentsatz']]
res['Bereich'] = res['Bereich'].apply(lambda x: int(x[2:]))

Advanced Functional Programming with Scala - Notes

Copyright © 2017 Fantasyland Institute of Learning. All rights reserved.

1. Mastering Functions

A function is a mapping from one set, called a domain, to another set, called the codomain. A function associates every element in the domain with exactly one element in the codomain. In Scala, both domain and codomain are types.

val square : Int => Int = x => x * x
map <M-h> previousTab
map <M-l> nextTab
let searchengine hayoo = "http://hayoo.fh-wedel.de/?query=%s"
let completionengines = ["google", "wikipedia", "hayoo"]
let searchalias h = "hayoo"
let hintcharacters = "asdfghjkl;"
let blacklists = ["https://mail.google.com/*","http://localhost/*","https://www.sharelatex.com/*"]
@freddie-freeloader
freddie-freeloader / eduroam_tuebingen
Created April 20, 2015 22:01
Netctl configuration for eduroam (tested and working for University of Tuebingen)
Description='eduroam'
Connection='wireless'
Interface=wlp3s0
Security='wpa-configsection'
Description="eduroam network"
IP='dhcp'
TimeoutWPA=30
WPAConfigSection=(
'ssid="eduroam"'
'proto=RSN'