Skip to content

Instantly share code, notes, and snippets.

View matthiasgoergens's full-sized avatar

Matthias Görgens matthiasgoergens

View GitHub Profile
@matthiasgoergens
matthiasgoergens / README.txt
Created November 15, 2018 07:28 — forked from ncw/README.txt
Client side certificates with go
This demonstrates how to make client side certificates with go
First generate the certificates with
./makecert.sh test@test.com
Run the server in one terminal
go run server.go
#!/usr/local/bin/python3.6
# -*- coding: utf-8 -*-
from hypothesis import given, example
import hypothesis.strategies as st
def linear_search(key, l):
"""Given a search key and a list of tuples (key, value), return
the first item that matches the key, or None if none match.
Example:
@matthiasgoergens
matthiasgoergens / vim
Created July 16, 2017 12:44
:set scriptnames
1: ~/dot-files/nvim/init.vim
2: /usr/local/Cellar/neovim/0.2.0_1/share/nvim/runtime/syntax/syntax.vim
3: /usr/local/Cellar/neovim/0.2.0_1/share/nvim/runtime/syntax/synload.vim
4: /usr/local/Cellar/neovim/0.2.0_1/share/nvim/runtime/syntax/syncolor.vim
5: /usr/local/Cellar/neovim/0.2.0_1/share/nvim/runtime/filetype.vim
6: /usr/local/Cellar/neovim/0.2.0_1/share/nvim/runtime/plugin/gui_shim.vim
7: /usr/local/Cellar/neovim/0.2.0_1/share/nvim/runtime/plugin/gzip.vim
8: /usr/local/Cellar/neovim/0.2.0_1/share/nvim/runtime/plugin/health.vim
9: /usr/local/Cellar/neovim/0.2.0_1/share/nvim/runtime/plugin/man.vim
10: /usr/local/Cellar/neovim/0.2.0_1/share/nvim/runtime/plugin/matchit.vim
@matthiasgoergens
matthiasgoergens / runlength.py
Created June 24, 2017 23:51
Runlegth encoding tested via hypothesis
#!/usr/local/bin/python3.6
# -*- coding: utf-8 -*-
from hypothesis import given, example
import hypothesis.strategies as st
def decode(l):
s = ""
for i, c in l:
s += i * c
return s
@matthiasgoergens
matthiasgoergens / binary_search.py
Last active June 24, 2017 23:06
Binary search tested with hypothesis
#!/usr/local/bin/python3.6
# -*- coding: utf-8 -*-
from hypothesis import given, example
import hypothesis.strategies as st
def linear_search(key, l):
"""Given a search key and a list of tuples (key, value), return
the first item that matches the key, or None if none match.
Example:
@matthiasgoergens
matthiasgoergens / Main.hs
Last active June 3, 2016 01:49 — forked from luciferous/Main.hs
STM example
{-# LANGUAGE ScopedTypeVariables #-}
module Main where
import Network ( withSocketsDo, listenOn, PortID(..) )
import Network.Socket ( accept, close, recv, send, Socket )
import Control.Concurrent ( forkIO, threadDelay, ThreadId )
import Control.Concurrent.STM ( atomically
, orElse
, newTChan
, readTChan
{-# LANGUAGE OverloadedStrings, RecordWildCards, LambdaCase #-}
import Conduit
import Data.Conduit
import Data.Conduit.Network
import qualified Data.ByteString.Char8 as BS
import Data.Conduit.TMChan
import Text.Printf (printf)
import Control.Concurrent.STM
import qualified Data.Map as Map
class MyClass:
def my_function(self, nice_verbose_variable):
some_other_variable = another_fairly_long_function(nice_verbose_variable,
"oh look, here's a str" +
"ing how great a layou" +
"t idea this is!")
some_other_variable = another_fairly_long_function(
nice_verbose_variable,
"oh look, here's a string, how great a layout idea this is!"