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 / 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 / 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 / react_ujs.js
Created July 20, 2015 23:38
Non-global react_ujs
/*globals React, Turbolinks*/
/* Modified react_ujs to prevent the components polluting global scope whenever possible.
* Since I use subdirs for my components, it also flattens the structure making
* _componentStore[className] possible.
* Creds for the react_ujs.js file to the people from react-rails (https://github.com/reactjs/react-rails)
*/
var path = require('path');
@rescribet
rescribet / base.rb
Last active September 17, 2016 06:06
A Turbolinks 5 drop-in for when permanent partials can't be lazy loaded (no-script requirement).
# A turbolinks 5 drop-in for when permanent partials can't be lazy loaded (no-script requirement).
#
# Whenever a static partial is really heavy, it is undesirable to render it on every/many request(s), so this render drop-in only renders the partial's content if the `Turbolinks-Referrer` header is *not* present.
#
# Usage:
# ```ruby
# render partial: 'navbar', permanent: true
# # => <div id="turbolinks_navbar" data-turbolinks-permanent="true">[Always rendered]</div> # Behaviour as described in the RailsConf '15 keynote, where HTML might be lazy loaded via JS
#
# render partial: 'navbar', permanent: 'navbar'