Skip to content

Instantly share code, notes, and snippets.

@maxymania
maxymania / SplitterLib.java
Created September 23, 2019 06:06
Unicode-Splitter in java.
// Public Domain!
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import java.util.function.IntFunction;
import java.util.function.IntPredicate;
import org.jparsec.Parser;
import org.jparsec.Parsers;
import org.jparsec.pattern.CharPredicate;
import org.jparsec.pattern.Pattern;
import org.jparsec.pattern.Patterns;
@maxymania
maxymania / liner.js
Last active December 11, 2019 13:12
NodeJS Line Reader using async/await
/*
Copyright (C) 2019 Simon Schmidt
Usage of the works is permitted provided that this instrument is retained with
the works, so that any entity that uses the works is notified of this instrument.
DISCLAIMER: THE WORKS ARE WITHOUT WARRANTY.
*/
const EventEmitter = require('events');
@maxymania
maxymania / hyperswitch.js
Last active December 30, 2020 17:02
NodeJS Hyperswarm utility.
/*
Copyright (C) 2019 Simon Schmidt
Usage of the works is permitted provided that this instrument is retained with
the works, so that any entity that uses the works is notified of this instrument.
DISCLAIMER: THE WORKS ARE WITHOUT WARRANTY.
*/
const hyperswarm = require('hyperswarm');
@maxymania
maxymania / PDF_Units.java
Created April 14, 2020 16:12
The units for Unit to Inch Conversion
// https://stackoverflow.com/questions/21520015/pdfbox-converting-inches-or-centimeters-into-the-coordinate-system
private static final int DEFAULT_USER_SPACE_UNIT_DPI = 72;
private static final float MM_TO_UNITS = 1/(10*2.54f)*DEFAULT_USER_SPACE_UNIT_DPI;