Skip to content

Instantly share code, notes, and snippets.

View jakoblorz's full-sized avatar
🚀
I can smell RP-1 in the air

Jakob Lorz jakoblorz

🚀
I can smell RP-1 in the air
View GitHub Profile
@jakoblorz
jakoblorz / FileStreamReader.java
Last active March 22, 2017 11:58
short general purpose snippet on how to read and write to files in java 8
/**
MIT License
Copyright (c) 2017 Jakob Lorz
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
@jakoblorz
jakoblorz / iri.service
Last active December 6, 2017 17:58
simple iri (iota) systemd service file to keep iri process running and start it when booting up
[Unit]
Description=IRI systemd daemon
[Service]
Restart=always
ExecStart=/usr/bin/java -jar /opt/iri/iri-1.4.1.2.jar -p 14265
[Install]
WantedBy=multi-user.target
@jakoblorz
jakoblorz / README.md
Last active December 11, 2017 11:56
Stepping Into Java - A Beginners Checklist

Stepping Into Java - A Beginners Checklist

So you want to learn Java? There are many guides, tutorial, videos etc. to help you learn it. Most of them do only seem to solve a specific problem, while learning a programming language is a continuous process of problem solving, getting stuck, having code-smell and then cleaning the smell out. Ok, drop the last two points, these points are things you might understand later in your carreer. This checklist will present you tasks / quests you can solve during your learning process. All of the problems you will face here were solved already, most software engineers of today worked with these kinds of problems at some point in their carreer as well.

The most significant skill software developers of today have is the skill to break a problem

@jakoblorz
jakoblorz / README.md
Created May 17, 2019 16:22
Simple global state without depending on any additonal state manager. Uses and exposes React Hooks.

I used this structure in multiple projects and had a blast using it which is why I want to share it. It automatically propagates state changes to all dependent states and does not require additional state managing packages such as redux or mobx.

It enables architectures where e.g. the navbar is at the same level as all other components while still receiving updates about e.g. current user: If in this example the Index View logs the user in, there will also be a re-render in the navbar as its state has changed. This construction removes the state-silos of each component. Using useState instead of useReflectedState still enables the usage of component-specific state.

import React from "react";
import ReactDOM from "react-dom";
import { BrowserRouter as Router, Route } from "react-router-dom";

import Navbar from "./views/Navbar";
import Index from "./views/Index";
@jakoblorz
jakoblorz / Implement.test.ts
Created July 20, 2019 11:45
Provide Mixins for javascript/typescript using an existing reference: Multiple classes reference a single instance (monostate-like)
/// <reference types="jest" />
import { Implement } from "./Implement";
test("should inherit methods of base class", () => {
const fn = jest.fn();
class Base {
implementation() {
fn();
@jakoblorz
jakoblorz / main.go
Created August 2, 2019 22:12
Simple jest-like output for golang
package main
import (
"encoding/hex"
"fmt"
"io"
"os"
"os/signal"
"runtime"
"sync"

Keybase proof

I hereby claim:

  • I am jakoblorz on github.
  • I am jakoblorz (https://keybase.io/jakoblorz) on keybase.
  • I have a public key ASDdbhoYAfnA7sPxrVksCvdv7RPZ2j7ofSKnlnYOFV7GbQo

To claim this, I am signing this object:

@jakoblorz
jakoblorz / bifurications-and-lyapunov.ipynb
Created May 29, 2020 17:23
Bifurications and Lyapunov.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@jakoblorz
jakoblorz / Example.ts
Created June 9, 2020 11:53
OO-agnostic State Transformer à la Redux, integratable using React Hooks
interface IUserController {
handleSetName(name: string): void;
}
interface IUserControllerState {
name: string;
}
class UserController
extends TransformController<IUserControllerState, IUserController>