Skip to content

Instantly share code, notes, and snippets.

@chickencoder
chickencoder / README.md
Last active July 7, 2019 18:18
README.md

Tiny, serverless shops

cyan

tiny scripting language

  1. A program is just a pure function
import { Env } from 'cyan'
const a = new Env()
@chickencoder
chickencoder / struct.md
Last active March 11, 2019 15:07
Struct Overview

Struct

Struct (perhaps https://struct.chat) is a reddit-like community platform for sharing interesting internet things. Struct is unique because the entire site exists within a single tree structure. Each 'post' or 'thread' is a called a 'branch'. Users can branch off any branch to add to the discussion or start something new.

A user's points are calculated by how many other users have branched off of the user's branches and how high these branches are up the tree. User levels are based upon how many points a user has. When a user has enough points, they are able to branch of the canopy (the top 3 layers of the tree).

trunc.chat is a unique community platform where the entire site is a data structure.

Users can gain roles/points by adding to the data structure. The more branches a post has, the higher an author's level.

Communities can form around posts. A post can have subscribers who listen to changes on that

@chickencoder
chickencoder / README.md
Last active February 21, 2019 13:32
Make cute little GraphQL APIs

Cute

Make cute little GraphQL APIs

Simple Hello World Query

import { build, query, returns } from 'cute'

const Hello = query('Hello', returns('String', () => 'Hello World'))
@chickencoder
chickencoder / README.md
Created February 10, 2019 21:29
Overview of the Delta Zero Distributed Messaging Network

d0 🤳

d0 (delta zero) is a protocol and network for sending authenticated communication through an anonymous medium.

How it works

d0 provides an index of live/idle message-transport instances. These instances are self-contained, in-memory websocket servers. By hosting these instances on a serverless platform such as now, the chat is essentially stateless meaning once the instance has been dormant for 15 minutes (or default sleep time for now lambdas), chat history is lost.

Users will register their public key and username with the main d0 instance and can then use jwt auth to start sending messages.

#Shorten bash path
PROMPT_DIRTRIM=3
#Show git branch and add colour
parse_git_branch() {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/'
}
export PS1="\u@\h \[\033[32m\]\w\[\033[33m\]\$(parse_git_branch)\[\033[00m\] ⚡ "

☂️ brolly

an instant in-memory now.sh data store

const brolly = require('brolly-store')

module.exports = (req, res) => {

👟

Run -

##########################
# 5v GND #
# |---[ 1k ]--(LED)---| #
##########################
POWER 5v
LD LED
R1 RES1K