Skip to content

Instantly share code, notes, and snippets.

View marcusradell's full-sized avatar

Marcus Rådell marcusradell

View GitHub Profile

Janit Backend

Our modular monolith server for Janit.

Values

  • High quality.
  • Simple solutions.
  • Early feedback.
  • Keep costs low.

Keybase proof

I hereby claim:

  • I am marcusradell on github.
  • I am marcusradell (https://keybase.io/marcusradell) on keybase.
  • I have a public key ASB9JvmuC9pmi239esha-2vS_fut8lWmbtorN94MLWTX5go

To claim this, I am signing this object:

@marcusradell
marcusradell / readme.md
Last active April 7, 2021 06:42
Mikado method

Mikado Method

Steps

  • Set a goal.
  • Experiment.
  • Visualize.
  • Undo.

Notes

TypeScript intro

How to setup TypeScript and use in a normal JavaScript project for learning purposes.

Preparations

  • mkdir lab-ts
  • cd lab-ts
  • git init
  • touch .gitignore. Add node_modules and dist to the file.
@marcusradell
marcusradell / readme.md
Created February 15, 2020 22:42
Writing a Wizard component

Writing a Wizard component

Background

We wanted a multi-step form (wizard) where we could move forward and backward. We wanted to be able to customize it in detail. Nuka-carousel almost worked for us and felt really stable.

Why not check out the source code and see if we can do our own version?

Reducers and tests

document.body.style.setProperty('--value', "pink");
// :root {
// --value: brown;
// }
// background: var(--value);
// 0 could become a problem as there is no delay.
import { Router } from 'express';
import { printCurls } from './curls';
import { modelFactory } from './model';
import { ExceptionResult, FailureResult } from '../../types';
import { CodeCaseAction } from './types';
import * as t from 'io-ts';
import { pipe } from 'fp-ts/lib/pipeable';
import { fold, either } from 'fp-ts/lib/Either';
import { Collection } from 'mongodb';
@marcusradell
marcusradell / test.ts
Created March 11, 2019 20:44
io-ts code kata
import { PathReporter } from "io-ts/lib/PathReporter";
import * as t from "io-ts";
const User = t.type({
nickname: t.string,
age: t.number
});
type User = t.TypeOf<typeof User>;
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
</head>
@marcusradell
marcusradell / 00_reports.ts
Last active January 24, 2018 13:12
PoC pure server
import { makeModel } from './model'
import { makeRouteDefs } from './route-defs'
import { makeRouteResolvers } from './route-resolvers'
import { makeServices } from './services'
export const makeReports = props => {
const { provider, salesModel } = props
const { serviceEffects } = provider
const { db, token } = serviceEffects