Skip to content

Instantly share code, notes, and snippets.

View rescribet's full-sized avatar

Thom rescribet

View GitHub Profile
@rescribet
rescribet / Application.kt
Last active December 24, 2021 16:53
KMongo certificate from environment
import com.mongodb.ConnectionString
import com.mongodb.MongoClientSettings
import eu.dexes.broker.persistence.sslContextFromCaCert
import io.ktor.application.Application
import io.ktor.util.InternalAPI
import org.litote.kmongo.coroutine.coroutine
import org.litote.kmongo.reactivestreams.KMongo
@OptIn(InternalAPI::class)
@Suppress("unused") // Referenced in application.conf
bytes read :ESC[
2020-05-15 23:15:34,449 [118046952] ERROR - terminal.emulator.JediEmulator - Unhandled Control sequence
parsed :ESC[22;2t
bytes read :ESC[
2020-05-15 23:15:34,449 [118046952] ERROR - terminal.emulator.JediEmulator - Unhandled Control sequence
parsed :ESC[22;1t
bytes read :ESC[
2020-05-15 23:15:34,449 [118046952] ERROR - terminal.emulator.JediEmulator - Unhandled Control sequence
parsed :ESC[23;2t
bytes read :ESC[
2020-05-16 12:26:05,834 [165478337] ERROR - annotator.RsExternalLinterPass - Wrong line: -1. Available lines count: 0
java.lang.IndexOutOfBoundsException: Wrong line: -1. Available lines count: 0
at com.intellij.openapi.editor.impl.LineSet.checkLineIndex(LineSet.java:212)
at com.intellij.openapi.editor.impl.LineSet.getLineStart(LineSet.java:193)
at com.intellij.openapi.editor.impl.DocumentImpl.getLineStartOffset(DocumentImpl.java:995)
at org.rust.cargo.toolchain.RustcSpan$Companion.toOffset(RustcMessage.kt:99)
at org.rust.cargo.toolchain.RustcSpan.toTextRange(RustcMessage.kt:84)
at org.rust.ide.annotator.RsExternalLinterFilteredMessage$Companion.filterMessage(RsExternalLinterUtils.kt:248)
at org.rust.ide.annotator.RsExternalLinterUtilsKt.createAnnotationsForFile(RsExternalLinterUtils.kt:178)
at org.rust.ide.annotator.RsExternalLinterPass.doApply(RsExternalLinterPass.kt:108)
2020-05-14 10:27:26,568 [64938388] ERROR - aemon.impl.PassExecutorService - CLion 2020.1.1 Build #CL-201.7223.86
2020-05-14 10:27:26,568 [64938388] ERROR - aemon.impl.PassExecutorService - JDK: 11.0.6; VM: OpenJDK 64-Bit Server VM; Vendor: JetBrains s.r.o
2020-05-14 10:27:26,568 [64938388] ERROR - aemon.impl.PassExecutorService - OS: Linux
2020-05-14 10:27:26,568 [64938388] ERROR - aemon.impl.PassExecutorService - Plugin to blame: Rust version: 0.2.121.3059-201-stable
2020-05-14 10:27:26,568 [64938388] ERROR - aemon.impl.PassExecutorService - Last Action: EditorLeft
2020-05-14 10:27:26,569 [64938389] ERROR - aemon.impl.PassExecutorService - Processing ended inconclusively
java.lang.IllegalStateException: Processing ended inconclusively
at org.rust.lang.core.cfg.CFGBuilder.process(CFGBuilder.kt:166)
at org.rust.lang.core.cfg.CFGBuilder.visitExprStmt(CFGBuilder.kt:219)
at org.rust.lang.core.psi.impl.RsExprStmtImpl.accept(RsExprStmtImpl.java:20)
@rescribet
rescribet / jsonld-parser.js
Last active October 21, 2019 08:36
JSON-LD parser connector for rdflib when not needing to support { termType: 'Collection' }
function convertTerm (kb, term) {
switch (term.termType) {
case 'BlankNode':
return kb.rdfFactory.blankNode(term.value);
case 'NamedNode':
return kb.rdfFactory.namedNode(term.value);
case 'Literal':
return kb.rdfFactory.literal(term.value, term.language || convertTerm(kb, term.datatype));
case 'DefaultGraph':
return kb.rdfFactory.defaultGraph();
@rescribet
rescribet / 0_results.md
Last active November 11, 2018 22:00
RDFLib PR parsing benchmark
@rescribet
rescribet / filterByArrIncludes.ts
Last active April 19, 2018 12:06
Variable types don't seem to be filtered by comparing them via an array includes statement.
abstract class SomeNode {
public readonly termType!: string;
}
class NamedNode extends SomeNode {
public readonly termType: "NamedNode";
constructor() {
super();
this.termType = "NamedNode";
@rescribet
rescribet / countLines.js
Last active December 19, 2018 09:24
Snippet to count the amount of lines added/removed in bitbucket pull requests
(function countLines() {
let addedArr = [];
let removedArr = [];
document.querySelectorAll('#commit-files-summary .lines-added').forEach((n) => { addedArr.push(n.innerText) });
document.querySelectorAll('#commit-files-summary .lines-removed').forEach((n) => { removedArr.push(n.innerText) });
let added = addedArr
.map((n) => parseInt(n))
.reduce((a, b) => { return b + a } );
let removed = removedArr
.map((n) => parseInt(n))
@rescribet
rescribet / trackers.txt
Last active April 26, 2016 19:26
List of (white line separated) trackers. There might be some dead in there, but it's a nice kick start for adding to dead transfers
udp://tracker.opentrackr.org:1337/announce
udp://9.rarbg.me:2710/announce
http://retracker.krs-ix.ru/announce
udp://9.rarbg.com:2710/announce
http://tracker.trackerfix.com/announce
@rescribet
rescribet / fetchHelpers.js
Last active August 9, 2016 19:41
The helpers we use to aid in using fetch with secure and non-secure (json) calls.
/**
*
* A regular non-safe get request:
* fetch('/profiles/foobar.json', jsonHeader());
*
* How this would look in a safe fetch request:
* fetch('/profiles.json', safeCredentials({
* method: 'POST',
* body: JSON.stringify({
* q: input,