Skip to content

Instantly share code, notes, and snippets.

View refset's full-sized avatar
🌍

Jeremy Taylor refset

🌍
View GitHub Profile
@refset
refset / Manual Voxel.js Export
Last active December 14, 2015 10:39
Enter this in the console to save your voxel creations :D ...and then in the distant future some kind soul can work out how to import it so you can look at it again! (this was working with voxel.jit.su on ~2 March 2013)
myobj = []
crunch = {}
chunkCache = []
crunch.encode = function(chunk, cb) {
var runs = [];
var i = 0;
function binRelX(elA, elB){
return elA > elB ? true : false
}
function binRelXObj(elA, elB, opts){
//opts, accessor,
var value = opts.value || "value"
return elA[value] > elB[value] ? true : false
}
@refset
refset / index.js
Created October 23, 2013 17:48
requirebin sketch
var proquint = require('proquint')// require something
var Buffer = require('buffer-browserify').Buffer
var s = "brfxxccxxmnpcccclllmmnprxvclmnckssqlbb11116"
var id = proquint.encode(Buffer(s+(s.length%2?" ":""),"utf-8"));
alert(s + "\n\n...is more pronouncible, in proquint form, as:\n\n" +id)
@refset
refset / org-freemind-to-org-mode.sh
Created April 13, 2016 15:51
Sed command to convert 4-space-indented Freeplane text (exported via copy/paste) to org-mode
sed 'h;s/[^ ].*//;s/ /*/g;s/$/ /;G;s/\n *//' file.txt > out.org
# the first line might need removing or manually editing to be 100% correy
# couldn't have done it without: http://unix.stackexchange.com/a/47210

Keybase proof

I hereby claim:

  • I am refset on github.
  • I am refset (https://keybase.io/refset) on keybase.
  • I have a public key ASAsN3gKAallnGDavX_bcgmSPlT8pkkOTwBA93-iGr1x8Ao

To claim this, I am signing this object:

merry: 11 0 11 0 11 11 0 0 11 0 11 0 11 11 0 0
merry2: 1 0 1 0 3 3 0 0 1 1 0 0 6 6 0 0 5 5 5 5
zebmas: 18 0 18 0 18 13 0 0 13 0 20 0 18 18 0 0
zebmas2: 0 1 1 1 0
song: +(merry; zebmas)
/ note transcription
/ C-3 C#3 D-3 D#3 E-3 F-3 F#3 G-3 G#3 A-3 A#3 B-3
/ 1 2 3 4 5 6 7 8 9 10 11 12
/ C-4 C#4 D-4 D#4 E-4 F-4 F#4 G-4 G#4 A-4 A#4 B-4

I've been working with Apache Kafka for over 7 years. I inevitably find myself doing the same set of activities while I'm developing or working with someone else's system. Here's a set of Kafka productivity hacks for doing a few things way faster than you're probably doing them now. 🔥

Get the tools

@refset
refset / C# test via PInvoke
Created January 2, 2020 17:58 — forked from buybackoff/C# test via PInvoke
LE query micro benchmark
[Test]
public void CursorShouldGetLessOrEqual() {
_db = _txn.OpenDatabase(flags: DbFlags.None);
var db2 = _txn.OpenDatabase("test_le",
DbFlags.Create | DbFlags.IntegerKey);
using (var cur = _txn.CreateCursor(db2)) {
int[] keys = new int[10000000];
@refset
refset / map-zipper.clj
Created April 29, 2020 16:14 — forked from dvingo/map-zipper.clj
Clojure zipper for recursively traversing a map
;; inspired by: https://clojuredocs.org/clojure.zip/zipper#example-54d91161e4b081e022073c72
(defn map-zipper
[m ref-keys]
{:pre [(set? ref-keys)]}
(z/zipper
(fn is-branch? [x]
(let [ret
(cond
(not (coll? x))
@refset
refset / crux-pull.clj
Created April 29, 2020 19:05 — forked from dvingo/crux-pull.clj
limited datomic pull api in crux.
(ns crux-pull
(:require
[edn-query-language.core :as eql]
[crux.api :as crux]
[my-app.crux-node :refer [crux-node]]))
(defn entity
([entity-id] (entity crux-node entity-id))
([crux-node entity-id]
(crux/entity (crux/db crux-node) entity-id)))