Skip to content

Instantly share code, notes, and snippets.

@mojobiri
mojobiri / unused environment variables.sh
Created April 22, 2021 10:41
List unused ENVironment variables on Heroku (rails)
# Lists ENV variable that not exists in the codebase.
# Helps to find potentially unused ENV variables on Heroku.
# cd into your-app-repo
heroku config --app your-app-name | grep -E -oh "^(.+): " | rev | cut -c 3- | rev | uniq | sort > your-app.env
cat your-app.env | xargs -P 0 -I % grep --include=*.{rb,yml,yaml,erb} -rohm1 . -e '%' | uniq | sort > repo.env
diff -y --suppress-common-lines your-app.env repo.env | grep -v -E 'HEROKU_|JAVA_HOME'
@mojobiri
mojobiri / gist:ba64cf3f53c17133666288e395b10d4c
Created March 25, 2020 10:57
Ruby Signal.list (Ubuntu, Windows)
Ubuntu 18.04.4 LTS, ruby 2.6.5p114:
{"EXIT"=>0, "HUP"=>1, "INT"=>2, "QUIT"=>3, "ILL"=>4, "TRAP"=>5, "ABRT"=>6, "IOT"=>6, "FPE"=>8, "KILL"=>9, "BUS"=>7, "SEGV"=>11, "SYS"=>31, "PIPE"=>13, "ALRM"=>14, "TERM"=>15, "URG"=>23, "STOP"=>19, "TSTP"=>20, "CONT"=>18, "CHLD"=>17, "CLD"=>17, "TTIN"=>21, "TTOU"=>22, "IO"=>29, "XCPU"=>24, "XFSZ"=>25, "VTALRM"=>26, "PROF"=>27, "WINCH"=>28, "USR1"=>10, "USR2"=>12, "PWR"=>30, "POLL"=>29}
Windows 10, ruby 2.7.0p0:
{"EXIT"=>0, "INT"=>2, "ILL"=>4, "ABRT"=>22, "FPE"=>8, "KILL"=>9, "SEGV"=>11, "TERM"=>15}
REASONS = {
person_not_relevant: "Person Not Relevant",
dont_kill: "Not Dead Yet",
ignore_account: "Ignore Account",
try_tomorrow: "Try Tomorrow",
try_next_week: "Try Next Week",
try_next_month: "Try Next Month",
try_in_3_months: "Try In 3 Months"
}
@mojobiri
mojobiri / Questions
Created September 9, 2011 14:06
RubyShift
Day job:
Favorite Ruby project:
Open Source contributions:
How do you use GitHub: