Skip to content

Instantly share code, notes, and snippets.

View Drahflow's full-sized avatar

Jens-Wolfhard Schicke-Uffmann Drahflow

View GitHub Profile
@Drahflow
Drahflow / main_test.go
Created August 28, 2019 14:37
Deadlock during tests in golang with sqlmock
package main
import (
"context"
"fmt"
"testing"
"net/http/httptest"
"github.com/DATA-DOG/go-sqlmock"
)
@Drahflow
Drahflow / backend.ey
Created July 10, 2019 19:49
Postgres<->REST with Elymas
"utils.ey" include
{ "=>" via
<<
»SELECT * FROM categories { ":" via
<< :color '' ==>color >> :name ==>
} each
>> "application/json; charset=utf-8" =>ok
} /returnCategories deffst
@Drahflow
Drahflow / gist:5b425879633d3c9db91ac8b57626bcc6
Last active November 27, 2018 21:41
"Goto statements make it hard to follow the control flow." Hold my beer.
// Issues maximal slots many parallel runs of f(item, ctl) and allows
// early abort from within f.
let abortableParallelApply = function*(iterable, slots, f) {
let aborted = false;
let running = 0;
for(let i of iterable) {
let run = f(i, {
callback(value) {
if(!aborted) protocol.next({run, value});
},
@Drahflow
Drahflow / gist:22c9936394c4a0de2992
Created November 2, 2015 14:08
Example Igor proofs
prove rtrclreclem.subset
autoall
expand df-rtrclrec
conclude ( ( r e. _V |-> U_ n e. NN0 ( r ^r n ) ) ` R ) = U_ n e. NN0 ( R ^r n )
use fvmpti2
distr:ante
use iunex
use relexpex
and rewrite
use ax-mp
@Drahflow
Drahflow / gist:c463717d5c72e114ac63
Created June 28, 2015 23:44
Elymas example program
"utils.ey" include
{ "=>" via
<<
»SELECT * FROM categories { ":" via
<< :color '' ==>color >> :name ==>
} each
>> "application/json; charset=utf-8" =>ok
} /returnCategories deffst
@Drahflow
Drahflow / From Xephyr to mensadisplay
Created October 28, 2014 23:06
Xephyr-based mensadisplay Xserver
diff -Nur -x '*Po*' ephyr/blitter.c mensadisplay/blitter.c
--- ephyr/blitter.c 1970-01-01 01:00:00.000000000 +0100
+++ mensadisplay/blitter.c 2014-10-28 22:46:41.360330844 +0100
@@ -0,0 +1,96 @@
+#include <xorg-server.h>
+
+#ifdef HAVE_CONFIG_H
+#include <kdrive-config.h>
+#endif
+