Skip to content

Instantly share code, notes, and snippets.

View chgeuer's full-sized avatar
🏠
Working from Düsseldorf

Dr. Christian Geuer-Pollmann chgeuer

🏠
Working from Düsseldorf
View GitHub Profile
@TeaDrivenDev
TeaDrivenDev / FsAdvent2019.md
Last active December 29, 2019 19:52
FsAdvent post for 2019

Paying It F#rward

This article is an entry in the 2019 F# Advent Calendar in English. Thanks to Sergey Tihon for organizing it, as always!

Note: This belongs on my blog, but some things are broken there right now, probably due to changes to GitHub Pages in recent years, so I'm publishing this here for now to at least get a reliable output.

The F# community, while small compared to those of many other languages, is known to be exceedingly open and helpful to beginners. I experienced this myself when I started learning the language nearly six years ago, and people (especially the F# MVPs) were always quick and eager to answer my newbie questions on Twitter, or wrote extensive answers on Stack Overflow or Code Review. Havi

@keathley
keathley / stateful_server.ex
Last active May 9, 2019 03:58
stateful_server example
defmodule Demo do
def demo do
_once_per_second = Demo.start(:once, 200)
_ten_per_second = Demo.start(:ten, 220)
_hundret_per_second = Demo.start(:hundret, 250)
IO.puts("Launced processes")
Process.sleep(1_500)
[:once, :ten, :hundret] |> show() |> IO.inspect()
@nilaydshah
nilaydshah / ASEPreRegistration.py
Last active July 12, 2019 07:59
ASE Pre-Registration Script
import argparse
import sys
import grp
import pwd
import subprocess
import os
import json
class PreRegistration:
defmodule Converter do
def convert_image(_a, _b, _c) do
:ok
end
end
defmodule Converter.StepBuilder do
defmacro __using__(_opts \\ []) do
quote do
Module.register_attribute(__MODULE__, :steps, accumulate: true)
#!/bin/bash
echo -n Password:
read -s password
echo
hash="$(echo -n $password | openssl sha1)"
upperCase="$(echo $hash | tr '[a-z]' '[A-Z]')"
prefix="${upperCase:0:5}"
response=$(curl -s https://api.pwnedpasswords.com/range/$prefix)
while read -r line; do
@KronicDeth
KronicDeth / elixirconf-2017-recap.md
Created September 22, 2017 21:18
Recap of all talks at ElixirConf 2017

Elixir Native UI - Boyd Multerer https://www.youtube.com/watch?v=77FW-jrCyCs

Thinking In Ecto - Darin Wilson https://www.youtube.com/watch?v=YQxopjai0CU

  1. Repository pattern https://youtu.be/YQxopjai0CU?t=2m12s
  2. Explicitness https://youtu.be/YQxopjai0CU?t=5m29s
@pierrejoubert73
pierrejoubert73 / markdown-details-collapsible.md
Last active September 24, 2026 09:33
How to add a collapsible section in markdown.

How to add a collapsible section in markdown

1. Example

Click me

Heading

  1. Foo
  2. Bar
    • Baz
  • Qux
@alexellis
alexellis / HackingOnLiveStreaming.md
Created June 1, 2017 12:48
HackingOnLiveStreaming

Additional notes

Original blog post - http://blog.alexellis.io/live-stream-with-docker/

How do I rebuild the image from scratch?

This will take several hours on a Raspberry Pi Zero - but less time on a Pi 2 or Pi 3. You can edit the Dockerfile for a Pi 2/3 and change RUN make to RUN make -j 4 to take advantage of the quad-core processor.

$ git clone https://github.com/alexellis/raspberrypi-youtube-streaming/
@mrange
mrange / RResult.md
Created March 18, 2017 12:32
Railway Oriented Programming and F# Result

Railway Oriented Programming and F# Result

Full source: https://gist.github.com/mrange/aa9e0898492b6d384dd839bc4a2f96a1

Option<_> is great for ROP (Railway Oriented Programming) but we get no info on what went wrong (the failure value is None which carries no info).

With the introduction F# 4.1 we got Result<_, _> a "smarter" Option<_> as it allows us to pass a failure value.

However, when one inspects the signature of Result.bind one sees a potential issue for ROP:

@mmainz
mmainz / demo.exs
Created September 23, 2016 13:37
The code of the short Elixir demo presented at the first Elixir Meetup in Düsseldorf
#### basic data types
x = 1
y = 2
x + y
string = "I am a string and a binary!"
binary = <<69, 76, 73, 88, 73, 82, 1>>
charlist = 'I am NOT a string'