Skip to content

Instantly share code, notes, and snippets.

View wneessen's full-sized avatar

Winni Neessen wneessen

View GitHub Profile
@wneessen
wneessen / docker.sh
Created January 25, 2021 11:38
Docker but in all possible misspelling
alias dockre='docker'
alias docekr='docker'
alias docerk='docker'
alias docrke='docker'
alias docrek='docker'
alias dokcer='docker'
alias dokcre='docker'
alias dokecr='docker'
alias dokerc='docker'
alias dokrce='docker'
#!/usr/bin/env python
import argparse
import json
import urllib.request
parser = argparse.ArgumentParser(
description="rspamd web interface statistic fetcher for InfluxDB usage")
parser.add_argument("--url", action="store",
help="URL to rspamd web interface installation")
@wneessen
wneessen / main.go
Created April 14, 2021 12:29
Check if date is first of quarter or semester
func IsFirstOfQuarter(t time.Time) bool {
dateString := t.Format("01-02")
if dateString == "01-01" ||
dateString == "04-01" ||
dateString == "07-01" ||
dateString == "10-01" {
return true
}
return false
}
\${[^}]+} for the whole - \${([^}]+)} to match only the part in between
## Shipping package
PROTO_ROOT_DIR = $(shell brew --prefix)/Cellar/protobuf/3.14.0/include
PROJECT_NAME = TESTGRPC
## Dart requires you to manually ship all google provided proto files too.
_gendart:
@mkdir -p model/gen/ship/dart
@protoc --dart_out=grpc:model/gen/ship/dart -I proto proto/server.proto --plugin=protoc-gen-dart=$$HOME/.pub-cache/bin/protoc-gen-dart
@protoc -I$(PROTO_ROOT_DIR) --dart_out=model/gen/ship/dart $(PROTO_ROOT_DIR)/google/protobuf/*.proto --plugin=protoc-gen-dart=$$HOME/.pub-cache/bin/protoc-gen-dart
@wneessen
wneessen / main.go
Created July 27, 2021 14:31
Read input
package main
import (
"bufio"
"log"
"os"
)
func main() {
stdinReader := bufio.NewReader(os.Stdin)