Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View awalterschulze's full-sized avatar
🇿🇦
Learning LeanProver

Walter Schulze awalterschulze

🇿🇦
Learning LeanProver
View GitHub Profile
@awalterschulze
awalterschulze / .gitignore
Created October 1, 2020 11:05
erlfmt rebar example
_build
Table Name
❌ |
File_name
File_Name
FileName
_File
@awalterschulze
awalterschulze / main.go
Created March 19, 2018 18:19
flatten and unflatten a json structure for a given field name.
package main
import (
"encoding/base64"
gojson "encoding/json"
"fmt"
"io"
"github.com/katydid/katydid/parser"
"github.com/katydid/katydid/parser/json"
@awalterschulze
awalterschulze / .gitignore
Last active September 2, 2022 10:42
compile git version inside go binary
mybinary
@awalterschulze
awalterschulze / .gitignore
Last active May 4, 2023 01:13
Problems with GADT and deriving
.stack-work
@awalterschulze
awalterschulze / Makefile
Created October 20, 2017 08:39
building go with a docker
GODOCKER = docker run --network host --rm --user $(shell id -u):$(shell id -g) -v $(PWD):/go/src/path/to/project -w /go/src/path/to/project golang:1.8.3-alpine3.6
GOFLAGS = -ldflags '-d' -tags netgo -installsuffix netgo
build:
$(GODOCKER) go build $(GOFLAGS) -o ./cmd/mycmd/mycmd ./cmd/mycmd
test:
$(GODOCKER) go test -test.v ./...
@awalterschulze
awalterschulze / Dockerfile
Created October 6, 2017 13:09
Run a cassandra in a docker with preloaded data
FROM cassandra:3.1.1
RUN mkdir -p /tmp/var/lib/cassandra /etc/cassandra \
&& chown -R cassandra:cassandra /tmp/var/lib/cassandra /etc/cassandra \
&& chmod 777 /tmp/var/lib/cassandra /etc/cassandra
RUN sed -i "s~/var/lib/cassandra~/tmp/var/lib/cassandra~g" /etc/cassandra/cassandra.yaml
COPY *.cql /tmp/
@awalterschulze
awalterschulze / goexperiencereport.md
Last active March 19, 2018 18:04
For Sum Types: Multiple return parameters are overrated

For Sum Types: Multiple return parameters are overrated

In this Go Experience Report I am going to make a case for sum types over multiple return parameters.

Analysis of multiple return parameters

I wrote a little tool which does some analysis of Go source code:

https://github.com/awalterschulze/goanalysis

@awalterschulze
awalterschulze / goexperiencereport.md
Last active September 24, 2017 14:47
Go Experience Report: Generic functions cannot be passed as values

Generic functions cannot be passed as values

While developing GoDerive, a code generator for Go, I ran into the following problem.

I could not infer the type of the input arguments of a function, if that function's input argument types are not specified and the function is not being called right away.

I wanted to write:

func TestCurriedEqualCompileError(t *testing.T) {
@awalterschulze
awalterschulze / Makefile
Created June 15, 2017 11:30
when docker-compose is not installed by docker is
DOCKER_COMPOSE := $(shell command -v docker-compose 2>/dev/null)
ifndef DOCKER_COMPOSE
DOCKER_COMPOSE = docker run --rm -i --volume /var/run/docker.sock:/var/run/docker.sock --volume $(shell pwd):/composefile -w /composefile docker/compose:1.8.1
endif