Skip to content

Instantly share code, notes, and snippets.

View GlenDC's full-sized avatar
🚀

Glen De Cauwsemaecker GlenDC

🚀
View GitHub Profile
@GlenDC
GlenDC / Cargo.toml
Last active December 17, 2023 02:11
simple hyper (0.14) tower-based http router
[package]
name = "router"
version = "0.1.0"
edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
hyper = { version = "0.14.27", features = ["full"] }
tower = { version = "0.4.12", features = ["full"] }
@GlenDC
GlenDC / triangles.html
Created December 5, 2022 20:52
Experiments with ChatGPT and GitHub Co-Pilot
<!DOCTYPE html>
<html>
<!-- Generated mostly with ChatGPT, with the help of GitHub Co-Pilot to correct some bits fast -->
<head>
<meta charset="UTF-8">
<title>My page</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/gl-matrix/2.8.1/gl-matrix-min.js"></script>
@GlenDC
GlenDC / christmas_carols.rs
Created April 23, 2021 18:59
Educative fun Rust snippets.
use std::io;
use std::str::FromStr;
const MAX_VERSE_COUNT: usize = 12;
const NUMBER_WORDS: [&str; MAX_VERSE_COUNT] = [
"a", "two", "three", "four", "five", "six",
"seven", "eight", "nine", "ten", "eleven", "twelve",
];
const NUMBER_COUNT_WORDS: [&str; MAX_VERSE_COUNT] = [
"first", "second", "third", "fourth", "fifth", "sixth",
@GlenDC
GlenDC / query_examples.md
Last active November 13, 2019 16:12
Rivine Query Examples (v2)
@GlenDC
GlenDC / bz_euclides.go
Last active August 4, 2019 20:30
extended algorithm of Euclides and the modular inverse of an element
// available at https://play.golang.org/p/COP6ErBkD47
package main
import (
"fmt"
)
func extended_algorithm_of_euclides(a, b int64) (d, s, t int64) {
var (
rx = a
@GlenDC
GlenDC / mijnziek.go
Created February 10, 2018 21:33
A simple tool to create a list of my (uncle's) music collection.
package main
import (
"fmt"
)
// TODO:
+ List all music, recursively, starting from a root dir, classify and dedupe it;
+ Integrate google drive (https://developers.google.com/drive/v3/web/quickstart/go) and upload music list;
@GlenDC
GlenDC / examples.md
Created May 24, 2017 14:49
g8stor copy vdisk examples

config.yml:

storageClusters:
  clusterA:
    dataStorage:
      - address: localhost:6379
    metaDataStorage:
      address: localhost:6379
 clusterB:
@GlenDC
GlenDC / client.go
Created May 9, 2017 02:58
Tor Hidden (TCP) Service Example in Golang
package main
import (
"log"
"os"
"strings"
"golang.org/x/net/proxy"
)
var _ = require("lodash");
var assert = require('assert');
// maxDifferenceOriginal computes the max difference z = x - y,
// where x.index > z.index, and `!EwA(w != z ^ w > z)`
// input: {a: 'input array containing all numbers'}
function maxDifferenceOriginal(a) {
// can only work with arrays
if(!_.isArray(a)) {
return -1;

Keybase proof

I hereby claim:

  • I am glendc on github.
  • I am glendc (https://keybase.io/glendc) on keybase.
  • I have a public key whose fingerprint is 7AE8 A55A 268C D623 FA29 DA67 DC93 FACE B4A2 D50D

To claim this, I am signing this object: