Skip to content

Instantly share code, notes, and snippets.

View steos's full-sized avatar

Stefan Oestreicher steos

View GitHub Profile
@steos
steos / quotes.md
Last active June 5, 2020 09:30
simplicity

Simplicity is prerequisite for reliability. -- Edsger W. Dijkstra

Everything should be made as simple as possible, but no simpler. -- Albert Einstein

Perfection is attained not when no more can be added, but when no more can be removed. -- Antoine de Saint Exupéry

Fools ignore complexity. Pragmatists suffer it. Some can avoid it. Geniuses remove it.

export const foo = 'foo';
@steos
steos / router.js
Last active August 29, 2015 14:16
bidirectional declarative microrouter (ES6)
'use strict';
import {first, rest, last, trimLeft, partial, partialRight, omit, dropRight,
zipObject, isObject, assign, ary, map, template} from 'lodash';
const placeHolderRegex = /:([a-zA-Z_][a-zA-Z0-9_]*)/g;
var trimLeadingColon = ary(partialRight(trimLeft, ':'), 1);
function assembleRoute(segment, routes) {
@steos
steos / Makefile
Created March 24, 2013 14:00
embedding blobs into executable
override CFLAGS += -Wall -Wextra -std=c99 -pedantic
.PHONY: all
all: demo
.PHONY: clean
clean:
rm *.o *.tar demo
demo.o: demo.c
@steos
steos / conflux.clj
Created December 8, 2012 20:18
minimal "language confluxer"
;;;; minimal "confluxer"
;;;; inspired by http://generators.christopherpound.com/
(require '(clojure [string :as str]))
(defn words [text] (str/split text #"\s+"))
(defn- word-triplets [s]
(partition 3 1 (str/capitalize (str s " "))))
@steos
steos / TestAsyncHttpClientDownloadProgress.java
Created May 24, 2012 14:37
test apache httpasyncclient download progress (with mpcorb dataset)
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.nio.ByteBuffer;
import java.util.concurrent.Future;
import java.util.zip.GZIPInputStream;
import org.apache.http.Header;
import org.apache.http.HttpException;
@steos
steos / Testing.java
Created December 2, 2011 11:13
swingx: customize jxtable hyperlinkprovider for better ux
import java.awt.Component;
import java.awt.Point;
import java.awt.Rectangle;
import java.awt.event.ActionEvent;
import java.awt.event.MouseEvent;
import javax.swing.JComponent;
import javax.swing.JFrame;
import javax.swing.JTable;
import javax.swing.UIManager;
@steos
steos / client.conf
Created November 9, 2011 18:26
openvpn config with lan gaming support
client
# specify server ip address here
remote <SERVER-IP>
dev tap
# name of the windows network connection
dev-node openVPN
@steos
steos / MinimalActiveMQPeerProtocolSample.java
Created November 4, 2011 12:57
minimal/naive sample on how to use activemq peer protocol
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.jms.Connection;
import javax.jms.DeliveryMode;
import javax.jms.Destination;
import javax.jms.JMSException;
import javax.jms.Message;
import javax.jms.MessageConsumer;
import javax.jms.MessageListener;
@steos
steos / TableFilterHilite.java
Created November 3, 2011 22:53
Java/Swing/JTable quick'n'dirty filter highlighting
import java.awt.Color;
import java.awt.Component;
import java.awt.Graphics;
import java.awt.Rectangle;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.DefaultRowSorter;
import javax.swing.JFrame;
import javax.swing.JPanel;