Skip to content

Instantly share code, notes, and snippets.

Avatar

Jonas Berlin xkr47

View GitHub Profile
@xkr47
xkr47 / ot-poi.txt
Last active Jun 9, 2019
Handy queries for Overpass Turbo - https://overpass-turbo.eu
View ot-poi.txt
// Handy search for POI objects - just swap `shop=kiosk` out for any `key=value` osm tag
(
node[shop=kiosk]({{bbox}});
way[shop=kiosk]({{bbox}});
rel[shop=kiosk]({{bbox}});
);
(._;>;);
out;
@xkr47
xkr47 / gulpfile.js
Last active Aug 17, 2017
Simple gulp debug transform
View gulpfile.js
var gt = require('through-gulp');
//...
gulp.src("...")
.pipe(/*...*/)
.pipe(gt(function visitFile(file, enc, cb) {
console.log("file '" + file.path + "' contents: " + file.contents.toString());
cb(null, file);
}, function visitEnd(cb) {
console.log("No more files");
cb();
@xkr47
xkr47 / README.md
Last active Aug 3, 2020
Logitech TrackMan Marble FX scroll wheel patch for the Linux kernel
View README.md

Logitech TrackMan Marble FX scroll wheel patch for the Linux kernel

NOTE I now have a standalone driver available here which is easier to install: https://github.com/xkr47/marblefx

This patch alters the usbmouse kernel driver to support a "scroll wheel mode" using the fourth button (the red button) when connected through a "ID 04d9:1400 Holtek Semiconductor, Inc. PS/2 keyboard + mouse controller" usb-to-ps2 adapter. No idea how things work with other adapters.

It seems the fourth button generates events, but the state of the button is not represented in any bits (at least by said usb-to-ps2 adapter).

@xkr47
xkr47 / acme-conf.json
Last active Mar 20, 2017
Brainstorming acme/letsencrypt configuration file
View acme-conf.json
"acme": {
"certstorePath": "/etc/certs/",
"accounts": [
{
"id": "nitor-srv01",
"provider": "acme://letsencrypt.org/...",
"acceptedAgreement": "https://letsencrypt.org/.../Agreement_v1.2.3.pdf",
"certificates": [
{
"id": "conflu",
@xkr47
xkr47 / DynamicCertOptions.java
Last active Jul 28, 2020
An attempt to support TLS SNI in vertx with dynamic reconfiguration support
View DynamicCertOptions.java
import io.vertx.core.Vertx;
import io.vertx.core.net.KeyCertOptions;
import javax.net.ssl.*;
import java.net.Socket;
import java.security.*;
import java.security.cert.X509Certificate;
public class DynamicCertOptions implements KeyCertOptions {
@xkr47
xkr47 / README.md
Last active Jan 17, 2017
irssi keybindings for switching between up to 999 windows
View README.md

irssi keybindings for switching between up to 999 windows

Use these keybindings to access up to 999 windows using at most 4 keys:

alt-0 .. alt-9 -> windows 0..9 (standard keybindings)
alt-q 0 .. alt-q 9 -> windows 10..19
alt-w 0 .. alt-w 9 -> windows 20..29
...
alt-p 0 .. alt-p 9 -> windows 90..99
alt-a 0 0 .. alt-a 0 9 -> windows 100..109
View keybase.md

Keybase proof

I hereby claim:

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

To claim this, I am signing this object:

@xkr47
xkr47 / README.md
Last active Aug 9, 2018
Using IntelliJ UI Designer for creating Swing forms in the Ceylon (1.3.0) language
View README.md

I wanted to create a Swing app in Ceylon and figured I'd give using the UI designer a shot. Here are the necessary steps to get it to work:

Steps

Change IDEA settings

  • From the menu: File -> Settings
  • Navigate to Editor / GUI designer
  • Make sure "Generate GUI into:" has Java source code selected
  • Change "Default accessibility for UI-bound fields:" is something else than "private", for example package-private
  • Click OK to save
View gulp-plumber-remedy.js
var gulp = require('gulp');
var util = require('gulp-util');
var source = require('vinyl-source-stream');
var buffer = require('vinyl-buffer');
var through2 = require('through2');
var plumber = require('gulp-plumber');
var errs = 0;
gulp.task('default', function () {
You can’t perform that action at this time.