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
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 June 12, 2020 12:43 — forked from aspnetde/App.fs
Feliz – MVU with React Function Components
module App
open Elmish
type State =
{ CurrentUser: string option }
type Msg =
| SignIn of string
| SignOut

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 / keybase.md
Created December 11, 2019 15:08
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 September 20, 2019 19:19 — forked from kevinswiber/siren_api.yml
Siren definitions for Open API Specification
swagger: '2.0'
info:
title: Siren API
description: Template for a Siren API
version: '0.1.0'
schemes:
- http
- https
basePath: /
produces:
@AlexZeitler
AlexZeitler / gist:2821442
Created May 28, 2012 22:17
Custom datetime formatting with JSON.NET and ASP.NET Web API
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));
user nginx;
worker_processes 1;
error_log /var/log/nginx/error.log warn;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
}
'use strict';
class Abstract {
// A static abstract method.
static foo() {
if (this === Abstract) {
// Error Type 2. Abstract methods can not be called directly.
throw new TypeError("Can not call static abstract method foo.");
} else if (this.foo === Abstract.foo) {
// Error Type 3. The child has not implemented this method.
throw new TypeError("Please implement static abstract method foo.");
FROM fluent/fluentd:v0.12.34
USER root
COPY ./etc/* /fluentd/etc/
COPY config.sh /fluentd/
RUN apk add --update --virtual .build-deps \
sudo build-base ruby-dev \
@AlexZeitler
AlexZeitler / ACCESS_ELASTIC.md
Created July 12, 2018 13:59 — forked from rochacbruno/ACCESS_ELASTIC.md
Docker-compose wait-to-start

When unsing docker compose you can have a problem with the order of dependent linked containers

The solution is to start a script which tries to access a service and waits until it gets ready before loading your program