Skip to content

Instantly share code, notes, and snippets.

🐃
what the heck

Chris de Graaf christopher-dG

🐃
what the heck
Block or report user

Report or block christopher-dG

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@christopher-dG
christopher-dG / oo.jl
Created Mar 11, 2019
Silly POC of OO-style instance methods in Julia
View oo.jl
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 Jan 9, 2019
Downloads YouTube channel metadata (video data, comments, playlists)
View youtube-channel-backup.py
#!/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 Dec 30, 2018
Discord.jl's doc bot
View djl.jl
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 Sep 27, 2018
Keeps the WICS live site in sync with master branch
View wics-webhook.go
// 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 Nov 25, 2017
CTB Max Combo Approximation
View ctb.py
#!/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)
You can’t perform that action at this time.