Skip to content

Instantly share code, notes, and snippets.

View reqshark's full-sized avatar
🪂
ridge soaring

Bent Cardan reqshark

🪂
ridge soaring
View GitHub Profile
@reqshark
reqshark / vedis.c
Created February 22, 2016 06:26
a copy of vedis
/*
* Symisc Vedis: A Highly Efficient Embeddable Data Store Engine.
* Copyright (C) 2013, Symisc Systems http://vedis.symisc.net/
* Version 1.2.6
* For information on licensing, redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES
* please contact Symisc Systems via:
* [email protected]
* [email protected]
* [email protected]
* or visit:
@reqshark
reqshark / sort.js
Last active February 6, 2016 00:59
deck sorting
exports.sortdeck = ( a ) => {
var rows = Math.floor(a.length / 4) + 1, ret = []
while (a.length) row(a)
return ret
function row (n) {
var r = rows, rs = []
while ( r-- )
if (n.length)
rs.push(n.pop());
ret.push(rs)
@reqshark
reqshark / join.md
Created February 5, 2016 01:12 — forked from heapwolf/join.md

JOIN

var store = require('store/client')(8001, '127.0.0.1');
var query = store.query;
var join = store.join;

var a = query('applications**'); // all keys in sublevel "applications" and any of its sublevels
var b = query('vendors*'); // all keys in "vendors"
@reqshark
reqshark / damnit.sh
Last active February 26, 2016 00:14
committing to the wrong branch again
git reset --soft HEAD^
git checkout branch
git commit
@reqshark
reqshark / logdb.md
Created January 19, 2016 06:37 — forked from dominictarr/logdb.md
ideas for a modular database

intro

we've had great success building modular database stuff on top of leveldb with node, but as I have learnt more about databases it's become apparent to me that the idea of a modular database would be better implemented at a slightly lower level.

Level db provides a sorted key:value store, which, because of the sorted property, many things can be implemented on top of. For example, for replication, or for consistent materialized views, we often need a write ahead log. This can easily be implemented via a batch write to level, and writing the log into a section of the leveldb key space which is treated as append only.

@reqshark
reqshark / protocol.c
Created January 7, 2016 22:09
WIP file save protocol
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/fcntl.h>
#include "libmill.h"
//#include "list.h"
@reqshark
reqshark / linux.sh
Last active November 21, 2015 11:25
buffer aligned MTU nonsense for the file system
# get system block size in bytes (RAM and disk)
sudo fdisk -l
# Disk /dev/ram1: 64 MiB, 67108864 bytes, 131072 sectors
# Units: sectors of 1 * 512 = 512 bytes
# Sector size (logical/physical): 512 bytes / 4096 bytes
# I/O size (minimum/optimal): 4096 bytes / 4096 bytes
# Disk /dev/sda: 223.6 GiB, 240057409536 bytes, 468862128 sectors
# Units: sectors of 1 * 512 = 512 bytes
@reqshark
reqshark / iosbuild.sh
Last active September 3, 2018 05:44
libmill iOS cross-compile for 32 bit (armv7) and 64 bit (arm64) iOS, and i386 and x86_64 simulators
# Copyright (c) 2015 Bent Cardan
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"),
# to deal in the Software without restriction, including without limitation
# the rights to use, copy, modify, merge, publish, distribute, sublicense,
# and/or sell copies of the Software, and to permit persons to whom
# the Software is furnished to do so, subject to the following conditions:
@reqshark
reqshark / init.coffee
Created November 4, 2015 07:50
atom server
# Your init script
#
# Atom will evaluate this file each time a new window is opened. It is run
# after packages are loaded/activated and after the previous editor state
# has been restored.
#
# An example hack to log to the console when each text editor is saved.
#
# atom.workspace.observeTextEditors (editor) ->
# editor.onDidSave ->
@reqshark
reqshark / reactnative.ios.js
Created November 1, 2015 05:41
react native object
{
ActivityIndicatorIOS: {
[Function]
displayName: 'ActivityIndicatorIOS',
propTypes: {
animating: {
[Function: checkType] isRequired: [Function: checkType]
},
color: {
[Function: checkType] isRequired: [Function: checkType]