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 / 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 / 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 / sodium_demo.c
Created March 4, 2016 07:23 — forked from GraxRabble/sodium_demo.c
This c file demostrates how to use each libsodium functions and lets you play with them to see their outputs.
/*
* GraxRabble
* 04 MAY 2014
* Note this was created for the 4.5 version of libSodium.
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "sodium.h" /* library header */
@reqshark
reqshark / parse-number.c
Created April 7, 2016 15:02 — forked from lpereira/parse-number.c
Number parsing using C11 _Generic
/* parse_number() using C11 _Generic */
/* @lafp, 2015-06-07 */
#include <stdlib.h>
#include <stdbool.h>
#include <stdio.h>
#include <errno.h>
#define parse_number(Input, Output) \
_Generic((*Output), \
int: parse_number_strtoint, \
@reqshark
reqshark / coro.c
Created April 7, 2016 15:08 — forked from lpereira/coro.c
Simple coroutine implementation in C
#include <stdio.h>
#include <stdint.h>
#include <stdlib.h>
#include <ucontext.h>
typedef struct coro_t_ coro_t;
typedef struct thread_t_ thread_t;
typedef int (*coro_function_t)(coro_t *coro);
typedef enum {
CORO_NEW,
@reqshark
reqshark / gist:7d93a23d6447f28fbea10f735a54d778
Last active July 30, 2016 21:21 — forked from chrissimpkins/gist:5bf5686bae86b8129bee
Atom Editor Cheat Sheet (Sweetmeat)

Use these rapid keyboard shortcuts to control the GitHub Atom text editor on Mac OSX.

Key to the Keys

  • ⌘ : Command key
  • ⌃ : Control key
  • ⌫ : Delete key
  • ← : Left arrow key
  • → : Right arrow key
  • ↑ : Up arrow key
@reqshark
reqshark / git.sh
Last active February 17, 2017 09:59 — forked from joannaong/git.txt
git
# damn it!
# committed to the wrong branch again
# fix trigger happy commits to wrong branch:
git reset --soft HEAD^
git checkout branch
git commit
# DELETE TAG
# ----------

Introduction

  • C-a == Ctrl-a
  • M-a == Alt-a

General

:q        close
:w        write/saves
:wa[!]    write/save all windows [force]
:wq       write/save and close
@reqshark
reqshark / style_guide.md
Created August 8, 2017 07:55 — forked from dominictarr/style_guide.md
style guide

High level style in javascript.

Opinions are like assholes, every one has got one.

This one is mine.

Punctuation: who cares?

Punctuation is a bikeshed. Put your semicolons, whitespace, and commas where you like them.

@reqshark
reqshark / 00-MINING.md
Created January 14, 2018 04:32 — forked from gboddin/00-MINING.md
Mining optimisation under Linux

Mining under linux

Disclaimer

I'm in no case responsible for fried hardware, erased software or burning down houses. Make sure your miners are always well cooled.

General recommendation

Though you can easily mix nVidia and AMD in the same rig with Linux, it's recommended to use a different thread for each platform so a Driver crash doesn't bring the whole rig down. It should be noted however, that some mining software have trouble when both architecture are found on the same rig.