Skip to content

Instantly share code, notes, and snippets.

View NoFishLikeIan's full-sized avatar
🦉
night owling

Andrea NoFishLikeIan

🦉
night owling
View GitHub Profile
@NoFishLikeIan
NoFishLikeIan / annotatewithbox.jl
Created July 26, 2021 17:19
Put box around annotate in Plots.jl
function annotatewithbox!(
fig::Plots.Plot,
text::Plots.PlotText,
x::Real, y::Real, Δx::Real, Δy::Real = Δx;
kwargs...)
box = Plots.Shape(:rect)
Plots.scale!(box, Δx, Δy)
Plots.translate!(box, x, y)
# Author: Gabriela Miyazato Szini and Andrea Titton - March 2021
import numpy as np
from itertools import permutations, combinations
np.random.seed(110792)
verbose = True
# Initialization
@NoFishLikeIan
NoFishLikeIan / ch_plot.jl
Created November 9, 2020 09:04
Plot chebyshev polynomials
function U(n, x)
if n == 0 return 0 end
if n == 1 return x end
return 2 * x * U(n - 1, x) - U(n - 2, x)
end
space = collect(range(0, 1, length=200))
plot(dpi=1000, legend=false, xaxis=false, yaxis=false, ticks=false)
@NoFishLikeIan
NoFishLikeIan / log-normal-mc.jl
Last active November 9, 2020 07:26
Simulating the moments of a log normal AR process
using Distributions, Random, StatsBase
ρ = 0.7
σ = 1
μ = 0
σ_y = σ / √(1 - ρ^2)
N = 10_000_000
@NoFishLikeIan
NoFishLikeIan / assignment_4.ipynb
Last active April 1, 2020 21:25
Assignment_4.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@NoFishLikeIan
NoFishLikeIan / hw_template.tex
Last active September 14, 2019 16:48
Latex homework template
\documentclass{article}
\usepackage{fancyhdr}
\usepackage{extramarks}
\usepackage{amsmath}
\usepackage{amsthm}
\usepackage{amsfonts}
\usepackage{tikz}
\usepackage[plain]{algorithm}
\usepackage{algpseudocode}
@NoFishLikeIan
NoFishLikeIan / README.md
Created July 25, 2019 09:20
Intro to advanced types ts

Typescript for the young and free

Some "advanced" types

The backend returns some optional fields but you want to write a function that makes those optional fields nullable. Why? No apperent reason.

type Response = {
  name: string;
 age?: number;
@NoFishLikeIan
NoFishLikeIan / melbourne.csv
Created July 21, 2019 19:16
Mock time series
Date Temp
1981-01-01 20.7
1981-01-02 17.9
1981-01-03 18.8
1981-01-04 14.6
1981-01-05 15.8
1981-01-06 15.8
1981-01-07 15.8
1981-01-08 17.4
1981-01-09 21.8
@NoFishLikeIan
NoFishLikeIan / main.py
Last active June 25, 2019 17:09
bootstrap-flask
from loguru import logger
from src.server import app, app_config
if __name__ == '__main__':
port = app_config['port']
host = app_config['host']
logger.info(f'Running on {host}:{port}')
app.run(**app_config)
@NoFishLikeIan
NoFishLikeIan / random_config.json
Created June 10, 2019 13:30
Configuration for appearance config.
{
"titleFontStyle": {
"color": {
"r": 0,
"g": 0,
"b": 0,
"a": 1
},
"fontFamily": "Times New Roman",
"fontSize": {