Skip to content

Instantly share code, notes, and snippets.

View EmmanuelOga's full-sized avatar
🏠
Working from home

Emmanuel Oga EmmanuelOga

🏠
Working from home
View GitHub Profile
@EmmanuelOga
EmmanuelOga / main.go
Created October 20, 2023 01:26
Simple recursive algorithm and its cost.
package main
import "fmt"
var cost int
func f2(s, e int) int {
cost += 1
if e <= s {
@EmmanuelOga
EmmanuelOga / resources.md
Last active October 4, 2023 11:58
Some resources on programming, computer science vs engineering, optimization
@EmmanuelOga
EmmanuelOga / bike.pl
Last active June 19, 2021 01:47
A bike in prolog
basicpart(rim).
basicpart(spoke).
basicpart(rearframe).
basicpart(handles).
basicpart(gears).
basicpart(bolt).
basicpart(nut).
basicpart(fork).
assembly(bike, [wheel, wheel, frame]).
import it.unimi.dsi.fastutil.objects.ObjectAVLTreeSet
data class Quad(val s: String = "", val p: String = "", val o: Comparable<Any>? = null, val c: String = "") :
Comparable<Quad> {
override fun compareTo(other: Quad): Int = compareValuesBy(this, other, Quad::s, Quad::p, Quad::o, Quad::c)
override fun toString(): String = "Q<S=$s P=$p O=$o C=$c>"
}
@EmmanuelOga
EmmanuelOga / XsltSparql.kt
Created January 11, 2021 15:52
Run SPARQL queries from Saxon using Rdf4J
package com.emmanueloga.xml
import com.emmanueloga.Config
import com.emmanueloga.FISHX
import com.emmanueloga.NAMESPACES
import com.emmanueloga.logger
import net.sf.saxon.s9api.*
import net.sf.saxon.s9api.ItemType.*
import net.sf.saxon.s9api.OccurrenceIndicator.*
import net.sf.saxon.s9api.SequenceType.makeSequenceType
@EmmanuelOga
EmmanuelOga / website.rf
Last active January 20, 2021 20:33
Rainbowfish file format.
.prefix : "https://emmanueloga.com/"
.prefix dc: "https://dc.com/rdf"
.prefix rdf: "https://w3.org/rdf"
.prefix rf: "https://rainbow.fish/"
.prefix schema: "https://google.com/schema"
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
rf:topic(:)
@EmmanuelOga
EmmanuelOga / package.json
Last active December 9, 2020 17:56
Nice reloadable boilerplate for JavScript projects with esbuild, chokidar and browser-sync.
{
"devDependencies": {
"browser-sync": "^2.26.13",
"chokidar": "^3.4.3",
"esbuild": "^0.8.21"
},
"dependencies": {
"cytoscape": "^3.17.0",
"lodash": "^4.17.20"
},
@EmmanuelOga
EmmanuelOga / .gitignore
Last active December 1, 2020 23:45
temp
node_modules
@EmmanuelOga
EmmanuelOga / short.request
Last active November 30, 2020 12:33
Caddy verbose and short configurations
GET http://localhost:2019/config/
HTTP/1.1 200 OK
Content-Type: application/json
Date: Mon, 30 Nov 2020 11:58:35 GMT
Content-Length: 389
Connection: close
{
"apps": {