Skip to content

Instantly share code, notes, and snippets.

View gutschilla's full-sized avatar
🏠
Working from home

Martin Dobberstein gutschilla

🏠
Working from home
View GitHub Profile

Keybase proof

I hereby claim:

  • I am gutschilla on github.
  • I am gutschilla (https://keybase.io/gutschilla) on keybase.
  • I have a public key ASCk5I1y-Qtu_WpC8284ASwAZGdt1tYsmKHwb3WTwx_wKQo

To claim this, I am signing this object:

@gutschilla
gutschilla / install-project-on-fresh-ubuntu.bash.sh
Last active March 6, 2021 12:08
provisioning server for elixir
#! /bin/bash
# I am exporting variables to have them in my shell after I ran the script.
# I find that convenient. Of course, those can/should be removed in "serious" deployments.
# create a time string between "1:00" and "5:59"
export REBOOT_TIME=`perl -e "print scalar(int 1 + 5 * rand) . q[:] . scalar(int 6 * rand) . scalar(int 9 * rand)"`
export HOSTNAME=`hostname`
export NETWORK_DEVICE=eth0 # might be different in cloud servers
https://github.com/houshuang/survey/blob/master/lib/mail/smtp_server.ex
@gutschilla
gutschilla / .emacs
Created April 6, 2016 13:24
my emacs config
;; backup files
(setq backup-directory-alist `(("." . "~/.saves")))
(setq backup-by-copying t)
(setq delete-old-versions t
kept-new-versions 6
kept-old-versions 2
version-control t)
;; packages
(setq package-archives '(("gnu" . "http://elpa.gnu.org/packages/")
@gutschilla
gutschilla / transformations.ex
Last active March 16, 2016 11:25
Elixir tramnsform snippets on my way from Perl to Elixir
# Perl:
my %map = ( a => 1, b => 2 );
my $fn_transform = sub { shift( @_ ) + 1 };
map {( $_ => $fn_transform->( $map{$_} ) )} keys %map;
# transform all values of a map
map = %{ a: 1, b: 2 }
fn_transform = &( &1 + 1)
Enum.into map, %{}, fn({k, v}) -> {k, fn_transform.(v) } end