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 / Readme.md
Last active August 28, 2024 13:04
paper-2021-language-derivatives-HTML

Generated Agda HTML is in the zip file

This makes it easier to read code using Go to Definition, since installing Agda is a challenge not everyone is up to

@awalterschulze
awalterschulze / .gitignore
Created October 1, 2020 11:05
erlfmt rebar example
_build
.. table:: Table Name
:widths: 1000 1000
+------------------+---------------------------------------------------+
| ❌ | ✅ |
+==================+===================================================+
| .. code:: erlang | .. code:: erlang |
| | |
| File_name | FileName |
| File_Name | _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 June 12, 2024 14:39
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) {