Skip to content

Instantly share code, notes, and snippets.

View Siedlerchr's full-sized avatar

Christoph Siedlerchr

  • Germany
  • 09:49 (UTC +01:00)
View GitHub Profile
#!/usr/bin/env python3
"""Simple HTTP Server With Upload and basic auth.
This module builds on BaseHTTPServer by implementing the standard GET
and HEAD requests in a fairly straightforward manner.
Code is based on:
see: https://gist.github.com/UniIsland/3346170
"""
@Siedlerchr
Siedlerchr / Test.java
Created July 20, 2017 16:59
MWE for Linux bug in javafx/swing accents
package application;
import javax.swing.JFrame;
import javax.swing.SwingUtilities;
import javafx.application.Platform;
import javafx.embed.swing.JFXPanel;
import javafx.scene.Group;
import javafx.scene.Scene;
import javafx.scene.control.TextField;
import codecs
import os
from nltk import word_tokenize
from nltk.corpus.reader.plaintext import PlaintextCorpusReader
from nltk.corpus import stopwords
from googletrans import Translator
from PyDictionary import PyDictionary
from googletrans import Translator
@Siedlerchr
Siedlerchr / ObjectListener.php
Created December 23, 2017 15:19 — forked from soyuka/ObjectListener.php
Streaming big json files the good way with php with https://soyuka.me/streaming-big-json-files-the-good-way/
<?php
namespace Fry;
use JsonStreamingParser\Listener;
/**
* This implementation allows to process an object at a specific level
* when it has been fully parsed
*/
@Siedlerchr
Siedlerchr / Map.js
Created May 23, 2018 12:31
OpenLayers map with overlay image
import 'ol/ol.css';
import Map from 'ol/map';
import View from 'ol/view';
import TileLayer from 'ol/layer/tile';
import OSM from 'ol/source/osm';
import Proj from 'ol/proj';
import Projection from 'ol/proj/projection';
import Coordinate from 'ol/coordinate';
import ImageStatic from 'ol/source/imagestatic';
import Image from 'ol/layer/image';
@Siedlerchr
Siedlerchr / Map.js
Created May 23, 2018 12:42
OpenLayers map with overlay image
import 'ol/ol.css';
import Map from 'ol/map';
import View from 'ol/view';
import TileLayer from 'ol/layer/tile';
import OSM from 'ol/source/osm';
import Proj from 'ol/proj';
import Projection from 'ol/proj/projection';
import Coordinate from 'ol/coordinate';
import ImageStatic from 'ol/source/imagestatic';
import Image from 'ol/layer/image';
--patch-module test=fastparse_2.12-1.0.0.jar
--patch-module test2=fastparse-utils_2.12-1.0.0.jar
--patch-module test3=sourcecode_2.12-0.1.4.jar
--add-exports javafx.controls/com.sun.javafx.scene.control=org.jabref
--add-exports org.controlsfx.controls/impl.org.controlsfx.skin=org.jabref
--add-exports javafx.graphics/com.sun.javafx.scene=org.controlsfx.controls
--add-exports javafx.graphics/com.sun.javafx.scene.traversal=org.controlsfx.controls
--add-exports javafx.graphics/com.sun.javafx.css=org.controlsfx.controls
--add-exports javafx.controls/com.sun.javafx.scene.control.behavior=org.controlsfx.controls
--add-exports javafx.controls/com.sun.javafx.scene.control=org.controlsfx.controls
@Siedlerchr
Siedlerchr / MaterialDesignIconEnum.java
Created March 13, 2020 22:30
JabRef Materal Design Icon
/**
*
* Icon Enum based on Material Design Icons v1.7.22
* https://materialdesignicons.com
*
* @author Jens Deters ([email protected])
*/
public enum MaterialDesignIcon{
@Siedlerchr
Siedlerchr / JabRefEclipse
Created April 6, 2020 16:19
JabRefEclipse
--patch-module test=fastparse_2.12-1.0.0.jar
--patch-module test2=fastparse-utils_2.12-1.0.0.jar
--patch-module test3=sourcecode_2.12-0.1.4.jar
--add-exports javafx.controls/com.sun.javafx.scene.control=org.jabref
--add-exports org.controlsfx.controls/impl.org.controlsfx.skin=org.jabref
--add-exports javafx.graphics/com.sun.javafx.scene=org.controlsfx.controls
--add-exports javafx.graphics/com.sun.javafx.scene.traversal=org.controlsfx.controls
--add-exports javafx.graphics/com.sun.javafx.css=org.controlsfx.controls
--add-exports javafx.controls/com.sun.javafx.scene.control.behavior=org.controlsfx.controls
--add-exports javafx.controls/com.sun.javafx.scene.control=org.controlsfx.controls
@Siedlerchr
Siedlerchr / TimeoutTelegrafjsBot.ts
Last active June 8, 2020 14:20
Sample for creating a Telegraf js bot scence with timeout
import * as util from 'util'
const setTimeoutPromise = util.promisify(setTimeout);
const TIMEOUT_MILLI_SECONDS = 10000;
export interface MyContext extends SceneContextMessageUpdate {
session: any,
}
const localSession = new LocalSession({
database: 'example_db.json',