Skip to content

Instantly share code, notes, and snippets.

View dominictarr's full-sized avatar

Dominic Tarr dominictarr

View GitHub Profile
@dominictarr
dominictarr / schema.js
Created August 6, 2014 22:19
git's secure datastructure described by a schema thingee
//top level is types, key:values are the structure that object must have,
//and the types of the values.
//Link means the hash of an object of the named type.
//Plus and Star define sets. And are just like regular expression + and *
//you could also have ? (Maybe) but it's not necessary to describe git.
{
COMMIT: {
//a cypherlink to a commit object
@dominictarr
dominictarr / usql.js
Created July 22, 2014 00:19
sql but with the look and feel of javascript
query('module', 'user')
if(module.author_id == user.id
&& user.name == 'substack')
return {
name: module.name,
version: module.version
}
switch(/(\w+)-/.match(module.name)[1])
reduce {
@dominictarr
dominictarr / index.js
Created May 19, 2014 13:22
lodash.noop
/**
* Lo-Dash 2.4.1 (Custom Build) <http://lodash.com/>
* Build: `lodash modularize modern exports="npm" -o ./npm/`
* Copyright 2012-2013 The Dojo Foundation <http://dojofoundation.org/>
* Based on Underscore.js 1.5.2 <http://underscorejs.org/LICENSE>
* Copyright 2009-2013 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
* Available under MIT license <http://lodash.com/license>
*/
/**
@dominictarr
dominictarr / level-magic.js
Last active August 29, 2015 14:01
Automagically join sql tables loaded into level
/*
Each table is put into it's own sublevel.
It's assumed that every table's primary key is ID.
and a foreign key is always {table}ID
If there isn't A table with that name, assume it's a self link.
(like ManagerID points back to the Employee table)
*/
//Automagically join two tables that have conventionally named fields.
// magic (nameOfLeftTable, nameOfRightTable)
@dominictarr
dominictarr / keybase.md
Last active September 2, 2024 01:12
keybase.md

Keybase proof

I hereby claim:

  • I am dominictarr on github.
  • I am dominic (https://keybase.io/dominic) on keybase.
  • I have a public key whose fingerprint is 652D 910D EC2B B18C 1E7B 2A00 296B 4A96 FC30 81C4

To claim this, I am signing this object:

April

08: Melbourne

17: Melbourne -> Frankfurt

head towards Budapest.

23: speaking at budapest node.js

24,25: speaking at craftconf.

@dominictarr
dominictarr / TahoeLAFS.md
Last active April 15, 2025 07:01
Writing out part of the Tahoe LAFS paper in my own words to check my understanding.

Tahoe LAFS

Tahoe LAFS is a distributed file system with an interesting permissions model. (whitepaper) Both Immutable and Mutable files are supported (Mutable is the most complex and interesting) There are three levels of permissions, Write, Read, and Verify. Each permission is granted by giving a user a special key called a "capability". If you have the Write capability you can update the file, if you have the Read capability you can retrieve the plain text, but if you only have the Verify capability you can only validate the file integrity, but not read the contents.

The lower level capabilities are generated deterministically from the higher level capabilites.

my thoughts on Ethereum

Ethereum is a proposed "metacoin" on top of the bitcoin protocol.

described here: http://ethereum.org/ethereum.html

One aspect which sounds interesting, but also potentially dubious is it's notion of turing complete contracts.

There is a very good reason that bitcoin does not have turing complete scripts, which pretty much the same as the reason that ethereum's (unimplemented) protocol might not work.

@dominictarr
dominictarr / README
Created October 28, 2013 01:16
blog example
oateuhn

Redecentralize SF 0

About 14-16 people met at noisebridge, the developers of several projects where present, cyphernet pkp, scramble.io, dat, and ShareJs

We discussed various approaches to building decentralized authentication, secure/private/anonymous email/messaging, data replication, conflict resolution and what it would take to make allow people to run their own services, and "own their own data"