Skip to content

Instantly share code, notes, and snippets.

@moritzschramm
moritzschramm / basic_plot.py
Created September 17, 2022 16:17
Basic matplotlib use case
import matplotlib.pyplot as plt
import numpy as np
# ',' instead of '.'
import locale
locale.setlocale(locale.LC_NUMERIC, "de_DE")
plt.rcdefaults()
plt.rcParams['axes.formatter.use_locale'] = True
textsize = 16 # textsize in pt
@moritzschramm
moritzschramm / .vimrc
Created September 14, 2022 18:22
Vim config
set nocompatible
filetype indent plugin on
syntax on
set hidden
set wildmenu
set hlsearch
set ignorecase
set smartcase
set backspace=indent,eol,start
set autoindent
@moritzschramm
moritzschramm / .env.example
Created October 2, 2017 11:32
Laravel docker setup
APP_NAME=
APP_ENV=local
APP_KEY=
APP_DEBUG=true
APP_LOG_LEVEL=debug
APP_URL=http://localhost
DB_CONNECTION=mysql
DB_HOST=mysql
DB_PORT=3306
@moritzschramm
moritzschramm / random_email.php
Created May 31, 2017 02:01
Generate random email with certain length (complies RFC 5321)
<?php
# see https://stackoverflow.com/questions/4356289/php-random-string-generator#answer-13212994
# generates INSECURE random string, do not use for tokens etc.
function generateRandomString($length = 10) {
return substr(str_shuffle(str_repeat($x='0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ', ceil($length/strlen($x)) )),1,$length);
}
# generates random email with certain length.
# tld is always .com and local part has always length 1