Skip to content

Instantly share code, notes, and snippets.

Benjamin Gudehus hastebrot

Block or report user

Report or block hastebrot

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
hastebrot / fezrotate.js
Created Jan 29, 2020 — forked from veeenu/fezrotate.js
Fez-like world rotation
View fezrotate.js
* Procedurally generated Minecraft dirt texture.
(function() {
var ctx, imgd;
ctx = document.getElementById('texture').getContext('2d');
imgd = ctx.createImageData(64, 64);
hastebrot / ctpuzzle.c
Created Nov 24, 2019
Solver for the c't puzzle by Uli Schuhmacher.
View ctpuzzle.c
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#define C if
#define T void
#define P NULL
#define U while
#define Z break
#define S return
#define L typedef
hastebrot / Blocks.txt
Last active Nov 6, 2019
Unicode Character Database (12.1.0)
View Blocks.txt
# Blocks-12.1.0.txt
# Date: 2019-03-08, 23:59:00 GMT [KW]
# © 2019 Unicode®, Inc.
# For terms of use, see
# Unicode Character Database
# For documentation, see
# Format:
# Start Code..End Code; Block Name
View StoreonDemo.js
import React from "react"
import createStore from "storeon"
import useStoreon from "storeon/react"
import StoreContext from "storeon/react/context"
import produce from "immer"
import { Pane, Button } from "fannypack"
export default () => {
return (
<StoreContext.Provider value={store}>
View RenderDemo.js
import React, { Fragment, useState, useEffect } from "react"
// this is similar to react's render().
export default () => {
const [state, setState] = useState({ count: 1 })
// this is similar to react's componentDidMount().
useEffect(() => {
setState({ count: 2 })
timeout(500, () => {
View Age of empires II AI Scripting
; The official HD AI
; An Artificial Intelligence Script written by Archon and Promiskuitiv
; Get in contact with Promiskuitiv by sending a mail to
; List of taunts it reacts to:
; Standard taunts.
; 33 - Stop slinging resources. If slinging is requested early and is immediately canceled it may mess up the strategy.
; 38 - Sling Resources. Human player only, stops any unit production except for civilian units.
View functional core, imperative

1. Separation of immutable and mutable logic

Quite a lot of different people have been on the same trail of thought. Gary Bernhardt's formulation of a "functional core, imperative shell" seems to be the most voiced.

"Boundaries" - Gary Bernhardt

"Imperative shell" that wraps and uses your "functional core".. The result of this is that the shell has fewer paths, but more dependencies. The core contains no dependencies, but encapsulates the different logic paths. So we’re encapsulating dependencies on one side, and business logic on the other side. Or put another way, the way to figure out the separation is by doing as much as you can without mutation, and then encapsulating the mutation separately. Functional core — Many fast unit tests. Imperative shell — Few integration tests


Mini Guide: kscript and kotlinx.coroutines

$ brew install holgerbrandl/tap/kscript
$ brew install maven
$ kscript demo.kts
Hello from Kotlin!
hastebrot /
Last active Apr 21, 2018
Browser Bookmarklets for Atlassian Jira

Browser Bookmarklets for Atlassian Jira

Jira is a proprietary issue tracking product, developed by Atlassian. It provides bug tracking, issue tracking, and project management functions.

"Jira (software)." Wikipedia, The Free Encyclopedia.


"Installation" of a bookmarklet is performed by creating a new bookmark, and pasting the code into the URL destination field. Alternatively, if the bookmarklet is presented as a link, under some browsers it can be dragged and dropped onto the bookmark bar. The bookmarklet can then be run by loading the bookmark normally.

  • receive / send
  • subscribe / dispatch
  • in / out
  • from server / to server
  • to client / from client
  • input stream / output stream
  • source / sink

Okio includes its own stream types called Source and Sink that work like InputStream and OutputStream

You can’t perform that action at this time.