Skip to content

Instantly share code, notes, and snippets.

View AlexZeitler's full-sized avatar
👷‍♂️
Building stuff

Alexander Zeitler AlexZeitler

👷‍♂️
Building stuff
View GitHub Profile
@AlexZeitler
AlexZeitler / setup-oh-my-zsh-powerlevel9k.sh
Created May 13, 2018 19:30
Installing zsh / oh-my-zsh / Powerlevel9k on Ubuntu 18.04
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."
@AlexZeitler
AlexZeitler / vscode-italics.json
Created July 12, 2021 15:30 — forked from dev01d/vscode-italics.json
VSCode italics in (almost) any theme
// All you need to do is add a font that has pretty good itlaics support i.e Fira, Operator, etc. and then add these two params to your existing User settings.
{
"editor.fontFamily": "'Operator Mono', Menlo, Monaco, 'Courier New', monospace",
"editor.tokenColorCustomizations": {
"textMateRules": [
{
"scope": [
"comment",
"keyword.control",
@AlexZeitler
AlexZeitler / set-keycloak-client-secret.groovy
Created July 11, 2021 19:02 — forked from goeh/set-keycloak-client-secret.groovy
Inject client secrets from a local file into a Keycloak Realm Export (JSON) file
import groovy.json.JsonSlurper
import groovy.json.JsonOutput
def jsonSlurper = new JsonSlurper()
def secrets = jsonSlurper.parse(new File(args[1] ?: "secrets.json")).clients.inject([:]) { map, c -> map[c.client] = c.secret; map }
def realm = jsonSlurper.parse(new File(args[0]))
for(client in realm.clients) {
if(secrets[client.clientId]) {
@AlexZeitler
AlexZeitler / LowercaseContractResolver.cs
Created April 5, 2012 12:06
LowercaseContractResolver for Json.NET serialization
public class LowercaseContractResolver : DefaultContractResolver {
protected override string ResolvePropertyName(string propertyName) {
return propertyName.ToLower();
}
}
@AlexZeitler
AlexZeitler / CloudAgent-1.fs
Created June 13, 2021 20:38 — forked from isaacabraham/CloudAgent-1.fs
Local Mailbox Processor
// Our simple domain model
type Priority =
| Low
| Normal
| High
type Message = {
Text : string
Priority : Priority
}
@AlexZeitler
AlexZeitler / 1_createRootCA.sh
Last active June 1, 2021 08:50
create selfsigned certificate with subject alternative name
#!/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
@AlexZeitler
AlexZeitler / HttpClient.FSharp.fs
Created May 30, 2021 19:57 — forked from jhewlett/HttpClient.FSharp.fs
Functional wrapper around System.Net.Http.HttpClient. Inspired in part by Http.fs (https://github.com/haf/Http.fs) and FSharp.Data (https://fsharp.github.io/FSharp.Data/library/Http.html)
namespace HttpClient.FSharp
open System
open System.Net.Http
type HttpMethod =
| Post
| Put
| Delete
| Get
@AlexZeitler
AlexZeitler / workflow.sh
Last active May 20, 2021 04:50
Run Atom / Visual Studio Code on Ubuntu via RDP
# 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 / idiomaticjsonserialiser.fs
Created May 15, 2021 23:25 — forked from isaacabraham/idiomaticjsonserialiser.fs
This JSON.Net converter handles F# discriminated unions with more "idiomatic" JSON than what is generated by the current version of JSON .NET. Option types and single case DUs are transparently handled, and tuple-style properties are used rather than array notation.
namespace Newtonsoft.Json.Converters
open Microsoft.FSharp.Reflection
open Newtonsoft.Json
open System
type IdiomaticDuConverter() =
inherit JsonConverter()
[<Literal>]