Skip to content

Instantly share code, notes, and snippets.

@nikku
nikku / DATA_LOADING_PATTERN.js
Created April 12, 2019 08:09
Data Loading Pattern
/**
* A publish / subscribe inspired pattern for
* modeling dependent data (and supporting efficient data-fetching).
*/
const DATA_STATE_UNAVAILABLE = {};
const DATA_STATE_LOAD_FAILED = {};
const DATA_STATE_LOADING = {};
const DATA_STATE_UNKNOWN = {};
const DATA_STATE_LOADED = {};
@nikku
nikku / DEFINITION_OF_DONE.md
Created January 22, 2019 08:27
A definition of done for libraries and applications alike.

Definition of Done

Issues may enter the needs review stage once their implementation conforms to our definition of done:

  • signed-off by you from user perspective
    • usable
    • discoverable (if feature)
    • fits with regards to existing functionality
  • signed-off by you from maintainer perspective
  • simple solution
@nikku
nikku / moddle-traverser.js
Created August 8, 2018 10:08
A simple traverser to visit each element in a Moddle tree
import moddle from 'moddle';
/**
* Traverse a moddle tree, depth first from top to bottom
* and call the passed visitor fn.
*
* @param {ModdleElement} element
* @param {Function} fn
*/
function traverse(element, fn) {
@nikku
nikku / camunda-modeler-1150-release.md
Created May 31, 2018 08:33
Camunda Modeler 7.9 Presentation

Camunda Modeler

enter image description here Last month(s) in review: 7 releases, 4 stable releases.

Modeler Improvements

  • FEAT: create from empty file
@nikku
nikku / fileassoc.nsh
Last active June 1, 2022 16:57
Better file association macros for NSIS (supporting per-user installation, too).
; fileassoc.nsh
; File association helper macros
; Written by Saivert
;
; Improved by Nikku<https://github.com/nikku>.
;
; Features automatic backup system and UPDATEFILEASSOC macro for
; shell change notification.
;
; |> How to use <|
@nikku
nikku / camunda-externa-task-worker-api.md
Last active February 20, 2018 14:33
Camunda external task worker API (Suggestion)

External Task Worker API Suggestion

var CamundaTasks = require('camunda-external-tasks');

var tasks = new CamundaTasks({
  ...config options, i.e. timeouts, auth interceptor, ...
});

// using with object decomposition
@nikku
nikku / diagram-js-to-es6-bundler-comparison.md
Created October 18, 2017 11:30
Comparing the bundle sizes of Gitter + diagram-js (ES5/ES6)
@nikku
nikku / TEST_DSL.kt
Last active February 23, 2022 10:36
Quick hack of a readable DSL for writing assertions in Kotlin
import kotlin.test.assertEquals
fun <T> equal(expected: T) : (T) -> Unit {
return { t ->
assertEquals(t, expected);
}
}
infix fun <T> T.should(matcher: (T) -> Unit) {
matcher(this);
@nikku
nikku / macify.md
Last active October 30, 2016 13:49

macify

You like good application screenshots? Use a few lines of imagemagick to translate your ugly Windows, Linux or whatever application screenshots into Mac style (but plain and platform agnostic) ones.

#!/bin/bash

# usage:
#
#   macify source dest
@nikku
nikku / SERVER_DISK_REPLACEMENT.md
Last active January 2, 2016 14:18
Clean RAID-1 disk replacement

Disk Replacement

This note looks into the neccessary operations to perform a clean disk replacement in RAID-1 environments.

Preparation

(0) Backup your data.
(1) Make sure your boot loader is installed on all RAID-1 disks.