Skip to content

Instantly share code, notes, and snippets.

🎲
Crushing It

Zeno zenozen

🎲
Crushing It
  • Somewhere
  • In the world
Block or report user

Report or block zenozen

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View test.js
function errorPromise() {
return new Promise((_resolve, _reject) => {
console.log('error coming up');
throw new Error('oops');
});
}
function okPromise() {
return new Promise((_resolve, _reject) => {
console.log('ok');
@zenozen
zenozen / build.gradle.kts
Created Feb 23, 2019
Kotlin + Gradle + JVM with JS project setup
View build.gradle.kts
plugins {
`java-library`
id("kotlin-multiplatform") version "1.3.21"
}
allprojects {
group = "xxx"
version = "1.0.0-SNAPSHOT"
}
@zenozen
zenozen / lmdb_bench.c
Created Oct 22, 2018
LMDB random vs seq write
View lmdb_bench.c
#include <stdio.h>
#include <string.h>
#include <stdint.h>
#include <stdlib.h>
#include <errno.h>
#include <sys/stat.h>
#include <sys/time.h>
#include <lmdb.h>
@zenozen
zenozen / .c
Created Oct 22, 2018
LMDB seq vs random write
View .c
#include <stdio.h>
#include <string.h>
#include <stdint.h>
#include <stdlib.h>
#include <errno.h>
#include <sys/stat.h>
#include <sys/time.h>
#include <lmdb.h>
@zenozen
zenozen / .c
Created Oct 22, 2018
LMDB seq vs random write
View .c
#include <stdio.h>
#include <string.h>
#include <stdint.h>
#include <stdlib.h>
#include <errno.h>
#include <sys/stat.h>
#include <sys/time.h>
#include <lmdb.h>
View keys.ts
class HList {
static hnil(): HNil {
return HNil.instance;
}
static hcons<V, Next extends HList>(value: V, next: Next) {
return new HCons<V, Next>(value, next);
}
}
class HNil extends HList {
static readonly instance = new HNil();
View init.lua
function invertTable(t)
local res = {}
for k, v in pairs(t) do
res[v] = k
end
return res
end
local capsMap = {
-- Arrow keys
View reifyTree-result.scala
{
val $u: `package`.this.universe.type = `package`.this.universe;
val $m: $u.Mirror = `package`.this.universe.runtimeMirror(this.getClass.getClassLoader);
$u.Expr.apply($m, {
final class $treecreator1 extends TreeCreator {
def apply[U >: Nothing <: Universe with Singleton]($m$untyped: Mirror[U]): (U)#Tree = {
val $u: U = $m$untyped.universe;
val $m: $u.Mirror = $m$untyped.asInstanceOf[$u.Mirror];
$u.Literal($u.Constant(3))
}
@zenozen
zenozen / java-utf8.sh
Created Sep 30, 2012
Add this to your .profile or .bashrc to fuck things up with java & UTF-8
View java-utf8.sh
alias javac='javac -J-Dfile.encoding=UTF8'
alias java='java -Dfile.encoding=UTF8' # What the fuck is this!!! Why should I do this!!! How stupid is JAVA!!!
You can’t perform that action at this time.