Skip to content

Instantly share code, notes, and snippets.

View elyukai's full-sized avatar
🏳️‍🌈

Lukas Obermann elyukai

🏳️‍🌈
View GitHub Profile
@jaredsinclair
jaredsinclair / Autocodable.swift
Last active January 22, 2022 00:23
[Notion]: Automatic Codable synthesis for Enums with Codable associated values.
enum MyEnum: Codable {
case foo
case bar(Int)
case baz(label: String)
case qux(Bool, label: String, Int)
case anotherCase(discriminator: String, anotherCase_1: Int)
}
// Begin synthesized code...
@lierdakil
lierdakil / example.ts
Last active September 19, 2022 13:28
An example of Functor in TypeScript. You can run this on https://www.typescriptlang.org/play/
interface Functor<T> {
map<U>(f: (x: T) => U): Functor<U>
}
class Box<T> implements Functor<T> {
value: T
constructor(x: T) {
this.value = x
}
map<U>(f: (x: T) => U): Box<U> {
@mobilemind
mobilemind / git-tag-delete-local-and-remote.sh
Last active September 27, 2024 17:33
how to delete a git tag locally and remote
# delete local tag '12345'
git tag -d 12345
# delete remote tag '12345' (eg, GitHub version too)
git push origin :refs/tags/12345
# alternative approach
git push --delete origin tagName
git tag -d tagName
@stain
stain / vocabulary-jsonld.json
Last active October 10, 2022 10:54
Example of how a simple OWL ontology / RDFS vocabulary could be defined with JSON-LD, defining the meaning of properties and classes. The second file shows the RDF triples of the vocabulary by using the JSON-LD sandbox. As a visualization - see http://www.essepuntato.it/lode/owlapi/https://gist.github.com/stain/7690362/raw/114f836a64291a3f894c44…
{ "@context": {
"rdf": "http://www.w3.org/1999/02/22-rdf-syntax-ns#",
"rdfs": "http://www.w3.org/2000/01/rdf-schema#",
"owl": "http://www.w3.org/2002/07/owl#",
"express": "http://example.com/express#",
"defines": {
"@reverse": "rdfs:isDefinedBy"
},
"propertyOf": {
"@id": "rdfs:domain",