Skip to content

Instantly share code, notes, and snippets.

@gizmaa
gizmaa / Plot_Examples.md
Last active June 11, 2025 03:13
Various Julia plotting examples using PyPlot
@aminnj
aminnj / install_vim.md
Created July 9, 2018 01:50
installing vim8.1 on slc7 computers

Execute the commands chunk by chunk because I haven't tested this as a whole

# setup environment
cd /cvmfs/cms.cern.ch/slc7_amd64_gcc630/cms/cmssw/CMSSW_10_2_0_pre6/ ; cmsenv ; cd -

# make containment folder somewhere and get vi
mkdir vim8
cd vim8
git clone https://github.com/vim/vim
@aminnj
aminnj / seamcarving.ipynb
Created September 9, 2020 21:36
Seam carving in python (basically https://www.youtube.com/watch?v=rpB6zQNsbQU but I don't want to learn Julia)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@aminnj
aminnj / heputils.py
Last active November 22, 2020 05:37
utilities for pandas + ROOT (via monkeypatching pandas)
import time
import numpy as np
import pandas as pd
import uproot
from yahist import Hist1D, Hist2D
from pandas.core.base import PandasObject
from cachetools import cached, LRUCache
from cachetools.keys import hashkey
def myhasher(*args, **kwargs):
# Electromagnetic simulation at varying timescales - simulation code to make this animation:
# https://twitter.com/bencbartlett/status/1369396941730312193
#
# Animation idea was inspired by u/cenit997's (Twitter: @__cenit) Reddit post:
# https://www.reddit.com/r/Python/comments/hxmhai/a_simulation_of_how_an_incoherent_light_source/
#---
using LinearAlgebra, Base.Threads, BenchmarkTools, LoopVectorization, CSV, DataFrames, Printf, Plots
@ChrisRackauckas
ChrisRackauckas / diffeqflux_vs_jax_results.md
Last active April 9, 2024 00:57
DiffEqFlux.jl (Julia) vs Jax on an Epidemic Model

DiffEqFlux.jl (Julia) vs Jax on an Epidemic Model

The Jax developers optimized a differential equation benchmark in this issue which used DiffEqFlux.jl as a performance baseline. The Julia code from there was updated to include some standard performance tricks and is the benchmark code here. Thus both codes have been optimized by the library developers.

Results

Forward Pass

@aminnj
aminnj / convert.md
Created July 28, 2021 01:33
ROOT tree from julia to python

Since writing out ROOT files is currently not possible with UnROOT, one can write out Arrow files directly from an UnROOT.LazyTree object which can be read back in julia. With some consideration of the chunking, this won't use much memory.

using UnROOT
using Arrow
using Tables

treename = "Events"
filename = "18BCCE71-15B8-194B-8738-EC993C8DD3BD.root"
@Azzaare
Azzaare / startup.jl
Last active September 13, 2024 02:43
Azzaare's startup.jl
# Add this file to ~/.julia/config/ (mkdir config if necessary)
try
using Coverage
catch e
@warn "Error initializing Coverage: trying install" exception = (e, catch_backtrace())
using Pkg
Pkg.add("Coverage")
end
@Moelf
Moelf / eduroam.8021x
Last active June 15, 2025 04:39
Harvard Secure and eduroam config for iwd and iwctl
[Security]
EAP-Method=TLS
EAP-Identity=<your harvard email>
EAP-TLS-CACert=/var/lib/iwd/usertrustrsacertificationauthority.cer
EAP-TLS-ClientCert=/var/lib/iwd/harvard_eduroam.p12
EAP-TLS-ClientKey=/var/lib/iwd/harvard_eduroam.p12
EAP-TLS-ClientKeyPassphrase=<your certificate password>
EAP-TLS-Phase2-Method=Tunneled-PAP
EAP-TLS-Phase2-Identity=<your harvard email>
EAP-TLS-Phase2-Password=<your harvard login password>
@jkrumbiegel
jkrumbiegel / makie_3d_barplot.jl
Created May 21, 2022 10:54
Makie 3D Barplot
@recipe(Barplot3D) do scene
Attributes(
color = theme(scene, :markercolor),
colormap = theme(scene, :colormap),
)
end
Makie.conversion_trait(::Type{<:Barplot3D}) = Makie.DiscreteSurface()
function Makie.plot!(p::Barplot3D)