Instantly share code, notes, and snippets.

Laszlo Korte laszlokorte

View GitHub Profile
laszlokorte / 0-test.php
Last active Jan 7, 2017
Php Serializable bug
View 0-test.php
// The root container object
class Root implements Serializable {
private $nodes;
private $mainNode;
public function __construct() {
$this->nodes = new IdentifierMap();
// Adds child object
View tsers-component.js
import {Observable as O} from "rx"
import hyper from "hyperscript-helpers"
const view = (DOM, model$) => {
const {div, h1, button} = hyper(DOM.h)
return DOM.prepare(model$.map(text =>
button("Click me!"),
View logic-model.js
import {Observable as O} from 'rx';
import I from 'immutable';
import {
} from '../lib/expression';
laszlokorte /
Created Dec 21, 2015 — forked from staltz/
The introduction to Reactive Programming you've been missing
View isolation.js
import Cycle from '@cycle/core';
import isolate from '@cycle/isolate';
import {makeDOMDriver, div} from '@cycle/dom';
import {Observable as O} from 'rx';
const Canvas = ({DOM, content$}) => {
const intent = (D) =>
toggle$: D
View cycle-dom-svg.js
'use strict';
var isArray = require('x-is-array');
// START Cycle.js-specific code >>>>>>>>
var h = require('@cycle/dom').h;
// END Cycle.js-specific code <<<<<<<<<<
var SVGAttributeNamespace = require('virtual-dom/virtual-hyperscript/svg-attribute-namespace');
var attributeHook = require('virtual-dom/virtual-hyperscript/hooks/attribute-hook');
laszlokorte / Material-Theme-Lighter.sublime-theme
Last active Nov 29, 2015
Some color and spacing adjustments
View Material-Theme-Lighter.sublime-theme
"class": "sidebar_label",
"color": [135, 145, 165],
"class": "sidebar_label",
"parents": [{"class": "tree_row", "attributes": ["expandable"]}],
"color": [145, 165, 175],
View write_to_file.php
file_put_contents(__DIR__ . '/test.txt', "Hello World");
// Only scalar values, both for parameters and return values.
// Calculation must be split into 2 methods. Ugly code, duplicate calculations.
public final class VectorMath {
public static double getRotatedX(final double x, final double y,
final double angle) {
return x * Math.cos(angle) - y * Math.sin(angle);
laszlokorte /
Last active Aug 29, 2015
JScrollpane and Textarea
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Component;
import java.awt.Dimension;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.MouseEvent;
import java.awt.event.MouseMotionAdapter;
import javax.swing.Box;