Skip to content

Instantly share code, notes, and snippets.

View samba2's full-sized avatar

Maik Toepfer samba2

View GitHub Profile
@samba2
samba2 / Casio-XW-J1-scripts.js
Created January 8, 2023 16:45
Improved Mapping for Mixxx and Vestax Spin2
// Script file for CasioXWJ1 mapping. Also works for Vestax Spin 2.
// For Mixxx V2
// Rodgers Akombe, 2019
// Based on prior work by:
// Tom Surace, 2013-2017
// Bill Good, Oct 31, 2010
// Anders Gunnarsson ???
// Others..?
// Work that is pending:
// 1. Functions requiring Shift Key have not been mapped/scripted
@samba2
samba2 / vscode-java-formatter.md
Created December 25, 2019 10:13
Visual Studio Code Java - Method Chain Formatting

Issue

By default VS Code Java squeezes chained methods into one line. The goal is to have VS Code Java behave similary to IntelliJ: the second and following methods are properly indented but not pulled back to the line which started the method chain.

In short:

Is (not good)

@samba2
samba2 / FIBCOB
Created July 11, 2017 12:44
Fibonacci sequence in COBOL including JCL to run it on Turnkey 4 (MVS)
//FIBCOB JOB (SETUP),
// 'Fibonaci Numbers',
// CLASS=A,
// MSGCLASS=H,
// MSGLEVEL=(1,1)
//FIB EXEC COBUCLG
//COB.SYSIN DD *
010 IDENTIFICATION DIVISION.
020 PROGRAM-ID. 'FIBCOB'.
030 **
@samba2
samba2 / fibonancci_numbers.c
Created June 9, 2017 06:50
Recursive Calculation Of The Fibonacci Sequence Of a Given Number
#include <stdio.h>
int fibbonacci(int n) {
if(n == 0) {
return 0;
} else if(n == 1) {
return 1;
} else {
return (fibbonacci(n-1) + fibbonacci(n-2));
}
@samba2
samba2 / demoservice-starter.sh
Last active February 26, 2017 22:29
Poor Man's Microservice Configuration Using Environment Variables
#!/usr/bin/env bash
set -ae # auto export env vars + stop script on error
trap 'kill $PID' TERM
source $1
gunicorn demoservice:app & # put your microservice start command here
PID=$!
wait $PID
Chain PREROUTING (policy ACCEPT)
target prot opt source destination
DOCKER all -- 0.0.0.0/0 0.0.0.0/0 ADDRTYPE match dst-type LOCAL
Chain INPUT (policy ACCEPT)
target prot opt source destination
Chain OUTPUT (policy ACCEPT)
target prot opt source destination
DOCKER all -- 0.0.0.0/0 !127.0.0.0/8 ADDRTYPE match dst-type LOCAL