Skip to content

Instantly share code, notes, and snippets.

View GlenDC's full-sized avatar
🚀

Glen De Cauwsemaecker GlenDC

🚀
View GitHub Profile
curl -o quine.f90 https://gist.githubusercontent.com/GlenDC/11dadd47137b2c1a5587/raw/ && \
alias _fortran='(gfortran -o quine quine.f90 && ./quine)' && \
alias _fotopy='(_fortran > quine.py && rm -f quine)' && \
alias _pytofo='(python quine.py > quine.f90)' && \
_fotopy && _pytofo && _fotopy && _pytofo && _fortran
@GlenDC
GlenDC / exploor-resizer.sh
Last active August 23, 2016 21:45
a shell script to resize activity images for exploor
#!/bin/bash
if [ "$#" -lt 1 ]; then
TARGET_DIR="."
else
TARGET_DIR="$1"
fi
if [ "$#" -lt 2 ]; then
ROOT_DIR="$HOME/exploor/images"

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:

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;
@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"
)
@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 / 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 / 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 / query_examples.md
Last active November 13, 2019 16:12
Rivine Query Examples (v2)
@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",