Skip to content

Instantly share code, notes, and snippets.

View Siedlerchr's full-sized avatar

Christoph Siedlerchr

View GitHub Profile
@Siedlerchr
Siedlerchr / build.gradle.kts
Created May 17, 2023 09:59
Download and extract protoc-gen.js and configure it
import com.google.protobuf.gradle.id
import de.undercouch.gradle.tasks.download.Download
import org.gradle.nativeplatform.platform.internal.DefaultNativePlatform
plugins {
id("java")
id("idea")
id("net.linguica.maven-settings") version "0.5"
`maven-publish`
id("com.google.protobuf") version "0.9.3"
@Siedlerchr
Siedlerchr / build.sh
Created April 12, 2023 18:50 — forked from mlabbe/build.sh
MacOS M1 cross compile and build a fat binary with aarch64/arm64 and x86_64/amd64
#!/bin/bash
clang hello.c -target arm64-apple-darwin20.1.0 -o hello.arm64
echo -n "hello.arm64 is architecture " && lipo -archs ./hello.arm64
clang hello.c -target x86_64-apple-darwin-macho -o hello.x86_64
echo -n "hello.x86_64 is architecture " && lipo -archs ./hello.x86_64
lipo hello.arm64 hello.x86_64 -create -output hello
echo -n "final output binary has archs " && lipo -archs ./hello
@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',
@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 / 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 (mail@jensd.de)
*/
public enum MaterialDesignIcon{
--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 / 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';
@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 / 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
*/
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