Skip to content

Instantly share code, notes, and snippets.

Avatar

José Bayoán Santiago Calderón, PhD Nosferican

View GitHub Profile
View makie_sankey.jl
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 Apr 24, 2020
Example script to download the latest version of all packages and their attendant artifacts (ignoring compatibility constraints)
View i_have_too_much_disk_space.jl
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[]
View Dynamic Panels.jl
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 May 19, 2022
Homebrew: Permissions Denied Issue Fix (OS X / macOS)
View homebrew-permissions-issue.md

Homebrew Permissions Denied Issues Solution

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