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"
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* 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: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
git reset --soft HEAD^ | |
git checkout branch | |
git commit |
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 -> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
ActivityIndicatorIOS: { | |
[Function] | |
displayName: 'ActivityIndicatorIOS', | |
propTypes: { | |
animating: { | |
[Function: checkType] isRequired: [Function: checkType] | |
}, | |
color: { | |
[Function: checkType] isRequired: [Function: checkType] |