Skip to content

Instantly share code, notes, and snippets.

View christopher-dG's full-sized avatar
🐃
what the heck

Chris de Graaf christopher-dG

🐃
what the heck
View GitHub Profile

Keybase proof

I hereby claim:

  • I am christopher-dG on github.
  • I am degraafc (https://keybase.io/degraafc) on keybase.
  • I have a public key whose fingerprint is C001 55D2 F174 E1EA BFA3 0F4B 9167 78DB B1B9 937C

To claim this, I am signing this object:

module Sodium
export seal
using Base64: base64encode, base64decode
const SEALBYTES = Ref{Csize_t}()
struct SodiumError
fun::Symbol
@christopher-dG
christopher-dG / oo.jl
Created March 11, 2019 15:17
Silly POC of OO-style instance methods in Julia
tablename(x::Symbol) = Symbol(:methtab_, x)
macro instancemethod(T::Symbol, ex::Expr)
@assert ex.head ∈ (:function, :(=))
table = tablename(T)
name = ex.args[1].args[1]
insert!(ex.args[1].args, 2, :(this::$T))
quote
$(esc(ex))
$table[$(QuoteNode(name))] = $name
@christopher-dG
christopher-dG / youtube-channel-backup.py
Created January 9, 2019 09:36
Downloads YouTube channel metadata (video data, comments, playlists)
#!/usr/bin/env python3
# Dependencies:
# - Python >= 3.6
# - google-api-python-client
# - requests
from argparse import ArgumentParser
from base64 import b64encode
@christopher-dG
christopher-dG / djl.jl
Last active November 3, 2020 11:26
Discord.jl's doc bot
using Discord
using REPL
const PREFIX = "julia> " # Cutesy Julia prompt.
const EMOTE = "<:julia:511658283090706453>" # Julia logo.
const COLOUR = 0x36393f # "Invisible" border for dark theme.
const CHRIS, JUAN = 0x0295605b65400000, 0x02a82393a1420002
const ADMINS = [CHRIS, JUAN]
chris_dm = nothing
@christopher-dG
christopher-dG / wics-webhook.go
Last active September 27, 2018 18:06
Keeps the WICS live site in sync with master branch
// Webhook handler for GitHub push events.
// Synchronizes the live website with the current master branch of umwics/wics-site.
//
// Required environment variables:
// - REPO_PATH
// - WEBHOOK_SECRET
// - WICS_KEY
//
// System dependencies:
// - bundler
@christopher-dG
christopher-dG / ctb.py
Last active November 25, 2017 14:27
CTB Max Combo Approximation
#!/usr/bin/env python3
# We want to guess how many combo units a CTB slider tends to be worth.
# We'll be looking at all catch-specific beatmaps with an FC as their top play,
# from 2010 to the present (Nov. 2017). For each beatmap, we want to count
# the max combo of the FC (this is guaranteed to be the max combo), the number
# of regular hit objects, and the number of sliders.
# To estimate slider combo, we'll compute:
# slidercombo = ((max combo - normal objects) / sliders)