Skip to content

Instantly share code, notes, and snippets.

View SebastiaanZ's full-sized avatar

Sebastiaan Zeeff SebastiaanZ

  • The Netherlands
View GitHub Profile
@SebastiaanZ
SebastiaanZ / new_style_iterator.py
Created October 31, 2021 08:05
Common iteration patterns would fail will new-style iterators
import itertools
class NewStyleIterator:
"""Iterator without an `__iter__` method itself."""
def __init__(self, iterable_data):
self.iterator = iter(iterable_data)
def __next__(self):
@SebastiaanZ
SebastiaanZ / config.yml
Last active October 19, 2020 18:18
Test Server Constants
bot:
prefix: "+"
token: !ENV "BOT_TOKEN"
sentry_dsn: !ENV "BOT_SENTRY_DSN"
redis:
host: "localhost"
port: 6379
password: !ENV "REDIS_PASSWORD"
use_fakeredis: false
@SebastiaanZ
SebastiaanZ / keybase.md
Created September 17, 2020 11:08
keybase.md

Keybase proof

I hereby claim:

  • I am sebastiaanz on github.
  • I am sebastiaanz (https://keybase.io/sebastiaanz) on keybase.
  • I have a public key ASDk5-CUcequyGcls2FMW13-70ySu8ggilfN2RnzIJhnJQo

To claim this, I am signing this object:

# R Cursus - Week 5: An introduction to programming in R
# Script: Shrinkage and the Bias-Variance trade-off
#
# Author: Sebastiaan
# Created: 2019-03-06
# Copyright: Universiteit Leiden
generate_data <- function(n, b=0.75, sd=2.5){
# Generates pairs of training and test sets
@SebastiaanZ
SebastiaanZ / mary_had_a_little_lamb.py
Last active March 2, 2019 08:35
Playing songs with the Adafruit Playground Express
# CircuitPlaygroundExpress_NeoPixel
from adafruit_circuitplayground.express import cpx
from random import randint
start = 55 # A1 in hz
f = 2**(1/12)
octaves = 8
scale = ["A", "A#", "B", "C", "C#", "D", "D#", "E", "F", "F#", "G", "G#"]