Skip to content

Instantly share code, notes, and snippets.

View HendrikRoth's full-sized avatar

Hendrik Roth HendrikRoth

  • Raphael GmbH
  • Dusseldorf, Germany
View GitHub Profile
@srlemke
srlemke / SimHub on Linux
Last active December 6, 2025 22:00
SimHub on Linux
Updated: 26.Nov.2025 - working again after some adjustments!
Reading is annoying some times, but read before start pasting commands.
This installs simhub per game, so you have to install it for each game.
All commands in a terminal as regular user, never as root.
Info: Linux games are isolated 'Compatibility Vessels' per game, it may look weird, but after understanding it better its
quite handy, if something goes wrong you just delete the whole 'vessel' and start from scratch, as if windows was reinstalled.
The vessel for each game has an unique ID.
@webcss
webcss / eventsmixin.js
Last active August 9, 2016 12:44
PubSub mixin using CustomEvents
// utilizes the browser eventsystem
// usefull in cases where you need communication between independent components
// registered events are automatically removed onunload with preserving any other onunload handler
var eventsMixin = function(target) {
var _subscriptions = [];
target.broadcast = function(type, payload) {
var ev = new CustomEvent(type, {
detail: payload,
@webcss
webcss / mithril-touch.js
Last active May 26, 2020 15:34
mithril-touch, consume touch and mouse events evenly with mithril
/*****************************************
/* DOM touch support module
/*****************************************/
if (!window.CustomEvent) {
window.CustomEvent = function (event, params) {
params = params || { bubbles: false, cancelable: false, detail: undefined };
var evt = document.createEvent('CustomEvent');
evt.initCustomEvent(event, params.bubbles, params.cancelable, params.detail);
return evt;
};
@jfromaniello
jfromaniello / gist:8418116
Last active September 19, 2023 23:38
Example of authenticating websockets with JWTs.
var WebSocketServer = require('ws').Server;
var wss = new WebSocketServer({port: 8080});
var jwt = require('jsonwebtoken');
/**
The way I like to work with 'ws' is to convert everything to an event if possible.
**/
function toEvent (message) {
try {