Skip to content

Instantly share code, notes, and snippets.

❯ elm make src/Benchmark.elm
Compiling ...
Success!
-- ERROR -----------------------------------------------------------------------
I ran into something that bypassed the normal error reporting process! I
extracted whatever information I could from the internal error:
> Error from `Benchmark` should have been reported already.
> CallStack (from HasCallStack):
Codec libary
- code generation in your IDE
- encoder/decoder pairs for 50% simpler code structure
- codec-independent (codec adapters for JSON, protobuf, cap'n'proto)
- interactive debugger
@janwirth
janwirth / RemoteData.d.ts
Last active January 6, 2020 06:22
JS Remote Data Type with Typescript Typings
// Example: RemoteData<HttpError, VehicleList>
export type RemoteData<E, D> = NotAsked | Loading | Failure<E> | Success<D>;
// Example: RemoteDataMatchers<HttpError, VehicleList>
export interface RemoteDataMatchers<E, D, R> {
NotAsked: () => R;
Loading: () => R;
Failure: (E) => R;
Success: (D) => R;
}
@janwirth
janwirth / Result.d.ts
Last active January 6, 2020 06:22
JS Result Data Type with Typescript Typings
/**
* An either type with more specific semantics
*/
type Result<O, E> = Ok<O> | Err<E>;
interface Ok<O> {
type: "Ok";
value: O;
}
@janwirth
janwirth / router.js
Created January 6, 2020 06:19
hyperapp router
import { fx } from "./utils/utils-fx.js";
/**
* Give it your handlers for url and it will reward you with an installation FX and a pushUrl function to update the history
* @param {{onLinkClicked: (url: URL) => any, onUrlChanged: (url: URL) => any}} handlers
* returns [any, (url: URL) => any]
*/
export const install = handlers => {
// bake the function manually pushing a new entry into the user's browser history
const pushUrl = fx((dispatch, url) => {
Task Time required Assigned to Current Status Finished
Calendar Cache > 5 hours @georgehrke in progress - [x] ok?
Object Cache > 5 hours @georgehrke in progress [x] item1
[ ] item2
Object Cache > 5 hours @georgehrke in progress
  • item1
  • item2
Object Cache > 5 hours @georgehrke in progress
Object Cache > 5 hours @georgehrke in progress
  • item1
  • item2
  • works
@janwirth
janwirth / blans.html
Created October 31, 2019 18:13
Hyperapp test app
<!DOCTYPE html>
<html lang="en">
<head>
<script type="module">
import { h, app } from "https://unpkg.com/hyperapp"
import {Http} from "https:/unpkg.com/hyperapp-fx@next?module"
const GotCats = (state, [cat]) => {
console.log(cat)
return {catPicture : cat.url, situation : "cat"}
}
@janwirth
janwirth / curry.md
Last active August 29, 2019 09:04
Curry Rezept

-- alle angaben geschätzt --

  • gemüse nach wahl und angebot (paprika, bohnen etc.)
  • fleischbeilage
  • gemüsebrühe
  • knoblach
  • zwiebel
  • kokosmilch
  • ganze geschälte tomaten aus der dose (2:1 zur kokosmilch)
  • curry pulver
"devDependencies": {
"create-elm-app": "^3.0.6",
"elm-analyse": "^0.16.4",
"elm-format": "^0.8.1",
"elm-i18n": "^1.0.2",
"elm-impfix": "^1.0.8"
},
"scripts": {
"start": "npm run i18n-ensure; elm-app start",
"build": "npm run i18n-ensure; elm-app build",
class Intersector extends HTMLElement {
constructor() {
super();
const threshold = 0;
var options = {
root: this.parentElement,
rootMargin: "-40% 0% -59%",
threshold: [threshold]
};