Skip to content

Instantly share code, notes, and snippets.

Alexander Zeitler AlexZeitler

View GitHub Profile
View PropertyExpression.ts
type Person = {
firstName: string
lastName: string
middleName?: string
}
const hasValue = (value: Record<string, any>, property: any): boolean =>
Boolean(value[property])
type ValueOf<T> = T[keyof T]
@AlexZeitler
AlexZeitler / App.fs
Created Jun 12, 2020 — forked from aspnetde/App.fs
Feliz – MVU with React Function Components
View App.fs
module App
open Elmish
type State =
{ CurrentUser: string option }
type Msg =
| SignIn of string
| SignOut
@AlexZeitler
AlexZeitler / setup-oh-my-zsh-powerlevel9k.sh
Created May 13, 2018
Installing zsh / oh-my-zsh / Powerlevel9k on Ubuntu 18.04
View setup-oh-my-zsh-powerlevel9k.sh
sh -c "$(curl -fsSL https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
git clone https://github.com/bhilburn/powerlevel9k.git ~/.oh-my-zsh/custom/themes/powerlevel9k
wget https://github.com/powerline/powerline/raw/develop/font/PowerlineSymbols.otf
wget https://github.com/powerline/powerline/raw/develop/font/10-powerline-symbols.conf
mkdir ~/.local/share/fonts/
mv PowerlineSymbols.otf ~/.local/share/fonts/
fc-cache -vf ~/.local/share/fonts/
mkdir ~/.config/fontconfig/conf.d/
mv 10-powerline-symbols.conf ~/.config/fontconfig/conf.d/
echo "Log out of your session and login again."
View Oh my zsh with autosuggestions & syntax-highlighting.md

Oh my zsh.

Install with curl

sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"

Enabling Plugins (zsh-autosuggestions & zsh-syntax-highlighting)

  • Download zsh-autosuggestions by
@AlexZeitler
AlexZeitler / install.txt
Last active Feb 19, 2020 — forked from tkfm-yamaguchi/lang.map.diff
source-highlight's language definition file for YAML
View install.txt
apt-get install source-highlight
# update .bashrc / .zshrc:
export LESSOPEN="| /usr/share/source-highlight/src-hilite-lesspipe.sh %s"
export LESS=' -R '
# add yaml support as shown in lang.map.diff
View keybase.md

Keybase proof

I hereby claim:

  • I am alexzeitler on github.
  • I am alexzeitler (https://keybase.io/alexzeitler) on keybase.
  • I have a public key ASB0qww7uSPAMkQCwMlF3wDCa-RQCliGbSSl4H7W1nx9yAo

To claim this, I am signing this object:

@AlexZeitler
AlexZeitler / siren_api.yml
Created Sep 20, 2019 — forked from kevinswiber/siren_api.yml
Siren definitions for Open API Specification
View siren_api.yml
swagger: '2.0'
info:
title: Siren API
description: Template for a Siren API
version: '0.1.0'
schemes:
- http
- https
basePath: /
produces:
@AlexZeitler
AlexZeitler / workflow.sh
Last active Sep 2, 2019
Run Atom / Visual Studio Code on Ubuntu via RDP
View workflow.sh
# Error before fixing:
# Xlib: extension "XInputExtension" missing on display ":10.0".
# Xlib: extension "XInputExtension" missing on display ":10.0".
#Find Atom / VS Code installation folder, e.g. /usr/share/atom or /usr/share/code
dpkg -L atom
dpgk -L visual-studio-code
#Find libxcb1 installation folder, e.g. /usr/lib/x86_64-linux-gnu/libxcb.so.1
dpkg -L libxcb1
@AlexZeitler
AlexZeitler / gist:2821442
Created May 28, 2012
Custom datetime formatting with JSON.NET and ASP.NET Web API
View gist:2821442
var config = GlobalConfiguration.Configuration;
var settings = new JsonSerializerSettings();
settings.Converters.Add(new IsoDateTimeConverter()
{
DateTimeFormat = "dd.MM.yyyy"
});
config.Formatters.Remove(config.Formatters.JsonFormatter);
config.Formatters.Add(new JsonNetFormatter(settings));
@AlexZeitler
AlexZeitler / 1_createRootCA.sh
Last active Mar 17, 2019
create selfsigned certificate with subject alternative name
View 1_createRootCA.sh
#!/usr/bin/env bash
mkdir ~/ssl/
openssl genrsa -des3 -out ~/ssl/rootCA.key 2048
openssl req -x509 -new -nodes -key ~/ssl/rootCA.key -sha256 -days 1024 -out ~/ssl/rootCA.pem
You can’t perform that action at this time.