Skip to content

Instantly share code, notes, and snippets.

View azenla's full-sized avatar
🏳️‍⚧️
cabbit mode

Alex Zenla azenla

🏳️‍⚧️
cabbit mode
View GitHub Profile

User Management Tool

Running

Linux

./bin/users.sh add -u jsmith -p changeme
library realdb.io;
import "dart:async";
import "dart:io";
import "dart:typed_data";
abstract class ByteStream {
Future<int> read();
Future<int> getPosition();
library realdb.io;
import "dart:async";
import "dart:io";
import "dart:typed_data";
abstract class ByteStream {
Future<int> read();
Future<int> getPosition();
Future<String> _createRowHash(String tableName, packed, {time, String salt}) async {
if (time == null) {
time = new DateTime.now().millisecondsSinceEpoch;
}
if (time is String) {
time = DateTime.parse(time).millisecondsSinceEpoch;
}
if (time is DateTime) {
@azenla
azenla / realdb.md
Last active November 4, 2015 19:01

RealDB

An efficient multi-purpose database and key-value storage engine. RealDB is inspired by MongoDB. RealDB's goal is to provide a single way to store collections of data, while also storing key-value data.

Concepts

Databases

A RealDB instance can have multiple databases.

import "package:gpio/gpio.dart";
import "package:raspberry_pi/raspberry_pi.dart";
import "package:os/os.dart";
main() {
PiMemoryMappedGPIO gpio = new PiMemoryMappedGPIO();
var lines = [];
for (var i = 0; i < 40; i += 2) {
var mode1 = gpio.getMode(i);
Catch-22:
A catch that is added to a statement that invalidates the original statement.
Example:
Statement: A crazy person may leave war if they ask to.
Catch: A person who wants to leave war is not crazy.
This example shows that asking to leave war means you are not crazy, and thus you cannot leave war.
@Location("/people")
@Many(Person, by: "username")
class People {
@Child(create: Person, description: "Add a Person")
Action addPerson;
}
@Profile("person")
@Editable()
class Person {
{
"people": { // This node does not have a value, but it's children can be a value, action, or plain node.
"$name": "People", // All nodes can have configs and attributes
"addPerson": { // This is can action which defines how to add a person.
"$name": "Add Person", // Defines a display name for this action.
"$invokable": "write", // Marks this as an action that requires write permission. This can also be 'read'.
},
"kaendfinger": { // Defines a child node.
"$name": "Kenneth Endfinger", // Display Name (In this case, the person's name) [Optional]
"age": { // Defines a value node.
#!/bin/sh
### BEGIN INIT INFO
# Provides: DGBox
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: DGBox Service
# Description: DGBox Service
### END INIT INFO