Skip to content

Instantly share code, notes, and snippets.

@Merovius
Merovius / backtrace.txt
Last active December 17, 2015 14:28
git_shorten_add segfaults when adding to many objects.
#0 0x00007ffff7b55d18 in push_leaf (os=0x6011f0, idx=32767, push_at=10,
oid=0x7fffffffdebb "fb1970fb98c05d1fc75a21cc9b977") at /home/mero/src/libgit2/src/oid.c:279
node = 0x7ffff6588ff0
leaf = 0x7ffff6389010
idx_leaf = -32768
#1 0x00007ffff7b55edc in git_oid_shorten_add (os=0x6011f0,
text_oid=0x7fffffffdeb0 "d8f11d9ac1afb1970fb98c05d1fc75a21cc9b977")
at /home/mero/src/libgit2/src/oid.c:388
tail = 0x7fffffffdeba "afb1970fb98c05d1fc75a21cc9b977"
c = 10
From 93883b8bf4a5d50e388db0d2eb95caebe2cdd42d Mon Sep 17 00:00:00 2001
From: Axel Wagner <mail@merovius.de>
Date: Sun, 1 Sep 2013 13:42:19 +0200
Subject: [PATCH] Correctly handle long lines
---
urxvt/shellex.in | 44 ++++++++++++++++++++++++--------------------
1 file changed, 24 insertions(+), 20 deletions(-)
diff --git a/urxvt/shellex.in b/urxvt/shellex.in
@Merovius
Merovius / client.go
Created September 19, 2013 18:59
Dbus minimal example in go, rudimentary implementation of http://www.galago-project.org/specs/notification/0.9/
package main
import (
"github.com/guelfey/go.dbus"
)
func main() {
conn, err := dbus.SessionBus()
if err != nil {
panic(err)
@Merovius
Merovius / new-jekyll-post.sh
Last active September 28, 2019 02:12
Automatically create a jekyll blogpost from a template. An editor is launched to edit the post, after it exits, the current date and time is added to the preamble and it is saved under a filename containing date and mangled article title into _posts. Optionally launches a jekyll server while editing the draft and commits the resulting blogpost.
#!/bin/sh
# The file extension to use for the post
FMT="markdown"
# Maximum length title used in filename
MAXLEN=32
# Wether or not to start a jekyll server for the draft
START_JEKYLL=true
# Wether to automatically commit the post or not
AUTOCOMMIT=true
@Merovius
Merovius / perm.go
Created August 12, 2014 09:08
Permutations
package main
import (
"fmt"
"math/rand"
"sort"
"time"
)
// Naive solution, create a new array and copy elements in right order. This
@Merovius
Merovius / main.go
Created September 11, 2014 19:08
Code für die c¼h "go tooling"
package main
import (
"flag"
"fmt"
"go/ast"
"go/build"
"go/parser"
"go/token"
"io"
@Merovius
Merovius / test.c
Created November 9, 2016 15:11
Demonstrate that stdin/stdout/stderr are only conventions.
#include <fcntl.h>
#include <stdlib.h>
#include <stdio.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <sys/wait.h>
#include <unistd.h>
// Demonstrate, that stdin, stdout, stderr are only conventional. We run a child
// process which doesn't have them open and open a random file to demonstrate,
@Merovius
Merovius / keybase.md
Created March 31, 2017 12:59
Keybase proof

Keybase proof

I hereby claim:

  • I am Merovius on github.
  • I am merovius (https://keybase.io/merovius) on keybase.
  • I have a public key whose fingerprint is CC3C C48D 048E 77B6 CAF0 B8DF 0426 F4D1 2C27 A9D4

To claim this, I am signing this object:

@Merovius
Merovius / 01.txt
Last active September 14, 2017 12:39
Was ist eigentlich dieses "internet" von dem immer alle reden?
__ __ _ _ _ _ _ _ _ _ _
\ \ / /_ _ ___ (_)__| |_ ___(_)__ _ ___ _ _| |_| (_)__| |_ __| (_)___ ___ ___ ___
\ \/\/ / _` (_-< | (_-< _/ -_) / _` / -_) ' \ _| | / _| ' \ / _` | / -_|_-</ -_|_-<
\_/\_/\__,_/__/ |_/__/\__\___|_\__, \___|_||_\__|_|_\__|_||_| \__,_|_\___/__/\___/__/
|___/
_ _ ___ _ _ _ _ _ _
( | )_ _|_ _| |_ ___ _ _ _ _ ___| |_( | ) __ _____ _ _ __| |___ _ __ (_)_ __ _ __ ___ _ _
V V | || ' \ _/ -_) '_| ' \/ -_) _|V V \ V / _ \ ' \ / _` / -_) ' \ | | ' \| ' \/ -_) '_|
@Merovius
Merovius / entropy.go
Last active January 15, 2018 00:18
Generating entropy without imports in Go
// https://blog.merovius.de/2018/01/15/generating_entropy_without_imports_in_go.html
package main
import "fmt"
func main() {
fmt.Println(MapIteration())
fmt.Println(Select())
fmt.Println(RaceCondition())