Skip to content

Instantly share code, notes, and snippets.

Avatar

Eric Hanson ericphanson

View GitHub Profile
@ericphanson
ericphanson / exp.jl
Last active Aug 28, 2021
Naive Julia port of rlibm32's exp implementation
View exp.jl
# https://github.com/rutgers-apl/rlibm-32/blob/44560acbd2ee22242989bdac259ad3665fa85d06/source/float/exp.c
include("constants.jl")
function rlibm_exp_ported(x::Float32)
# u is fx.x in the original code
u = reinterpret(UInt32, x)
# Take care of special cases
if (0x42b17218 <= u <= 0xb3000000)
@ericphanson
ericphanson / Cancel.yml
Created Oct 17, 2021
GitHub actions workflow for cancelling CI when a newer commit is pushed
View Cancel.yml
name: Cancel
on:
push:
branches:
- main
- master
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
jobs:
cancel:
@ericphanson
ericphanson / examples.txt
Created Jan 20, 2022
Julia script to run processes with 2 second timeout
View examples.txt
❯ ./timeout.jl ps
PID TTY TIME CMD
697 ttys000 0:00.16 -zsh
1132 ttys001 0:00.09 /bin/zsh --login
3115 ttys002 0:00.09 /bin/zsh -l
3632 ttys003 0:00.32 /bin/zsh -l
11816 ttys003 0:00.32 /Users/eph/.asdf/installs/julia/1.7.1/bin/julia --color=yes --startup-file=no -O0 --compile=min ./timeout.jl ps
❯ ./timeout.jl sleep 3 && echo "done"