Skip to content

Instantly share code, notes, and snippets.

View paulsonnentag's full-sized avatar

Paul Sonnentag paulsonnentag

View GitHub Profile

Moby-Dick, or, the Whale

By Herman Melville


In Token of my admiration for his genius, this book is inscribed to Nathaniel Hawthorne.

const AACHEN = { lat: 50.7753, long: 6.0839 };
reaction(
() => Day.getAll(),
(days) => {
days.forEach(async (day) => {
const forecast = await getWeatherForecast(AACHEN, day.start, day.end);
if (!forecast) {
import React from 'react'
import ReactDOM from 'react-dom/client'
import {RoomDB} from "./roomdb.js";
const root = ReactDOM.createRoot(document.getElementById('root'))
const db = new RoomDB();
db.claim(["Aachen", "lat", 50.775555])
@paulsonnentag
paulsonnentag / todo-item.design.js
Created March 31, 2020 18:43
Piku to-do item example
// This file is automatically generated from the state chart and the frames
export default TodoItem;
const TodoItem = new EntityDefinition({
name: 'Todo',
isParallel: true,
states: {
TodoItem&
Completion
Done
toggle -> Pending
Pending
toggle -> Done
Mode
Reading
App
Todo&
Completion
Pending
toggle -> Done
Done
toggle -> Pending
Mode
Function Search
Start
search -> Start with Results
Start with Results
select function -> Function
delete all -> Start
Module
backspace -> Start
search -> Module
select function -> Function
const fs = require('fs');
const path = require('path');
const {spaceName, paperNumbers} = require('./config.json');
const knex = require('knex')({
client: 'pg',
connection: process.env.DATABASE_URL,
});
const initialCode = fs.readFileSync(path.join(__dirname, 'initial-code.js'), 'utf8')
@paulsonnentag
paulsonnentag / 1-modify-schema-example.scala
Last active May 22, 2020 14:15
Scala example Avro schema modifcation
// ...
// creating a new schema with the fields of the old schema added plus the new fields
val schema = // ... the schema of the input data
var newSchema = SchemaBuilder
.builder(schema.getNamespace)
.record(schema.getName)
.fields()