Skip to content

Instantly share code, notes, and snippets.

View Nosferican's full-sized avatar

José Bayoán Santiago Calderón Nosferican

View GitHub Profile
@jkrumbiegel
jkrumbiegel / makie_sankey.jl
Created March 12, 2022 13:25
sankey makie
function sankey!(target, x1, x2, bend, start_min, start_max, stop_min, stop_max, color_start, color_stop)
bezier(t, p1, p2, p3, p4) = (1 - t)^3 * p1 + 3(1 - t)^2 * t * p2 + 3 * (1 - t) * t^2 * p3 + t^3 * p4
b(t, start, stop) = begin
p_start = Point2f(x1, start)
p_stop = Point2f(x2, stop)
c1 = Point2f(x1 + bend * (x2-x1), start)
c2 = Point2f(x2 - bend * (x2-x1), stop)
bezier(t, p_start, c1, c2, p_stop)
end
@staticfloat
staticfloat / i_have_too_much_disk_space.jl
Last active April 24, 2020 08:07
Example script to download the latest version of all packages and their attendant artifacts (ignoring compatibility constraints)
empty!(Base.DEPOT_PATH)
push!(Base.DEPOT_PATH, joinpath(@__DIR__, "depot"))
using Pkg
Pkg.update()
registry_dir = joinpath(@__DIR__, "depot", "registries", "General")
regdict = Pkg.Types.read_registry(joinpath(registry_dir, "Registry.toml"))["packages"]
ctx = Pkg.Types.Context()
all_pkgspecs = Pkg.Types.PackageSpec[]
using CSV, DataFrames, Econometrics, GLM, Statistics, TableView
# Read in the data - unbalanced panel
# Data from https://rdrr.io/cran/panelvar/man/abdata.html
df = CSV.read("abdata.csv", copycols = true)
# We start by estimating standard OLS on our data, running the model
#
# yᵢₜ = α₁Lyᵢₜ + α₂L²yᵢₜ + β₁wᵢₜ + β₂Lwᵢₜ + β₃kᵢₜ + β₄Lkᵢₜ + β₅L²kᵢₜ + β₆ysᵢₜ + β₇Lysᵢₜ + β₈L²ysᵢₜ
# + ∑yearₜ
@irazasyed
irazasyed / homebrew-permissions-issue.md
Last active April 11, 2024 10:37
Homebrew: Permissions Denied Issue Fix (OS X / macOS)

Homebrew Permissions Denied Issues Solution

sudo chown -R $(whoami) $(brew --prefix)/*