Skip to content

Instantly share code, notes, and snippets.

View Siedlerchr's full-sized avatar

Christoph Siedlerchr

  • Germany
  • 16:10 (UTC +02:00)
View GitHub Profile
@daeh
daeh / Papers3_to_Zotero.py
Last active September 6, 2024 18:58
Import Papers 3 library into Zotero
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""Script to facilitate the import of a Readcube Papers 3 library into Zotero
__Purpose of this script__
If you export your Readcube (Mekentosj) Papers3 library as a BibTeX file, the file paths to the PDFs are not formatted
correctly for Zotero to import them.
@jsreynolds
jsreynolds / Windows Defender Coding Exclusions.ps1
Last active April 30, 2022 13:37
Windows Defender Coding Exclusions
# Run as admin!
# Note you can run more than once - it will not create duplicates
# Based off of https://gist.github.com/dknoodle
$userPath = $env:USERPROFILE
$pathExclusions = New-Object System.Collections.ArrayList
$processExclusions = New-Object System.Collections.ArrayList
# Visual Studio 2019
@pwillis-els
pwillis-els / Heap_Dump_Java_AWS_ECS.md
Created June 29, 2020 14:13
Dumping heap of a Java process running in AWS ECS

Heap dumping a Java process running in AWS ECS

Note: this guide is designed for AWS ECS services, but starting from Step 4 is functionally equivalent to any Docker container on a Linux host.

Step 1. Look up ECS service

  1. Log into the AWS Console using the appropriate AWS account
  2. Navigate to AWS ECS service clusters (https://console.aws.amazon.com/ecs/home)
  3. Make sure you are in the correct region, if not, switch to the correct region (second drop-down menu in top right corner)
  4. Select the correct cluster (ex: https://console.aws.amazon.com/ecs/home?region=us-east-1#/clusters//services)
  5. In the Services tab, In the 'Filter in this page' text box, type the name of the service
@jfet97
jfet97 / clone.js
Last active May 9, 2021 19:33
Using graph theory to clone JavaScript objects with circular references
function isObject(entity) {
return typeof entity === "object" && entity !== null;
}
function cloneNonObjectProperties(obj) {
return Object.fromEntries(
Object.entries(obj).filter(([, v]) => !isObject(v))
)
}
@mlabbe
mlabbe / build.sh
Created December 11, 2020 23:08
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
@customcommander
customcommander / jsdoc-cheat-sheet.md
Last active March 12, 2025 12:10
JSDoc Cheat Sheet
@gmk57
gmk57 / CoroutineTimer.kt
Last active September 16, 2024 13:55
Coroutine-based solution for delayed and periodic work
/**
* Coroutine-based solution for delayed and periodic work. May fire once (if [interval] omitted)
* or periodically ([startDelay] defaults to [interval] in this case), replacing both
* `Observable.timer()` & `Observable.interval()` from RxJava.
*
* In contrast to RxJava, intervals are calculated since previous run completion; this is more
* convenient for potentially long work (prevents overlapping) and does not suffer from queueing
* multiple invocations in Doze mode on Android.
*
* Dispatcher is inherited from scope, may be overridden via [context] parameter.
@jfet97
jfet97 / DFS.js
Last active August 26, 2023 10:02
Simple Depth First Search in JavaScript
function isObject(entity) {
return typeof entity === "object" && entity !== null;
}
function getAdjacentNodes(obj) {
return (
Object.entries(obj)
.filter(([, v]) => isObject(v))
)
}
@LilithWittmann
LilithWittmann / autobahn.md
Last active January 14, 2025 12:25
autobahn.md
@creckord
creckord / autobahn-openapi.md
Last active February 13, 2025 14:39
(Inoffizielle) Autobahn API OpenAPI 3.0 Spezifikation

Autobahn API als (Inoffizielle) OpenAPI 3.0 Spezifikation

Hier mal ein einfacher Aufschlag einer OpenAPI Spezifikation für die von Lilith Wittmann entdeckte API der neuen BMVI Autobahn-Info App

Die Definition basiert auf den Beispieldaten einiger Testaufrufe und wird sicher unvollständig und evtl teilweise inkorrekt sein...