Skip to content

Instantly share code, notes, and snippets.

View D3MZ's full-sized avatar
😎

Demetrius Michael D3MZ

😎
View GitHub Profile
@D3MZ
D3MZ / ad-block-list.txt
Created September 29, 2017 21:03
Bad websites to advertise on
www.breitbart.com
@D3MZ
D3MZ / idiosyncrasies-python.md
Created February 27, 2025 15:44
Idiosyncrasies in Python

you cannot reference folders with - in the name

from player-random.agent import Agent #player-random/agent.py won't work
from player_random.agent import Agent #player_random/agent.py does work

overly short and inconsistent naming are ideomatic

import pandas as pd
@D3MZ
D3MZ / random_walks.jl
Last active September 9, 2025 18:09
In the example, the residuals subtract a walk from a random walk. This could be used for evaluating a model to find the reference pattern.
using Plots
walk(n_steps; start=0.0, step_std=1.0) = cumsum([start; randn(n_steps) .* step_std])
residual(y) = walk(length(y) - 1) .- y
residuals(y, n) = [residual(y) for _ in 1:n]
#Example
reference = walk(100)
plot(reference, linewidth=4, label="Reference")
plot!(residuals(reference, 10), alpha=0.7, label=false)