Skip to content

Instantly share code, notes, and snippets.

Books

  • negotiate like your life depends on it
  • throwing rocks at the google bus
  • kopf schlägt kapital OK
  • an der freiheit des anderen kommt keiner vorbei OK
  • elegant objects OK
  • the war on normal people
  • Kinder der Ewigkeit OK
  • das kalte herz
  • wenn die liebe fremdgeht
function makeElmCompatible () {
// Prevent content editable from deleting the text node that elm renders to
document.addEventListener('keydown', event => {
const zeroWidthSpace = '​'
// only for content editable
if (event.target.contentEditable !== 'true') {
return
}
// prevent deletion of last character and replace with zero width space instead
if (event.key === 'Backspace') {
@janwirth
janwirth / elmapp.config.js
Created March 12, 2019 09:07
Edit babel configuration in create-elm-app
module.exports = {
configureWebpack: (config, env) => {
const rules = config.module.rules
rules
.map(r => {
// find js rule
if (r.test && r.test.toString().indexOf('js') > -1) {
// find the rule with the actual babel config
if (r.use) {
r.use[0].options.plugins = r.use[0].options.plugins || []
class Intersector extends HTMLElement {
constructor() {
super();
const threshold = 0;
var options = {
root: this.parentElement,
rootMargin: "-40% 0% -59%",
threshold: [threshold]
};
class Intersector extends HTMLElement {
constructor() {
super();
const threshold = 0;
var options = {
root: this.parentElement,
rootMargin: "-40% 0% -59%",
threshold: [threshold]
};
"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",
@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
@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"}
}
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 / 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) => {