Skip to content

Instantly share code, notes, and snippets.

View diegogub's full-sized avatar
👽

Diego Guraieb diegogub

👽
View GitHub Profile
@diegogub
diegogub / 00-NOTES.md
Created April 24, 2024 18:57 — forked from krisleech/00-NOTES.md
Notes on Clojure ring handlers and middleware

Ring handler a function which accepts a request (map) and returns a response (map).

Ring middleware

function (handler, &args -> function(request -> response) because it is a closure handler and &args are in scope within the returned handler function.

a function which accepts a "next handler" (the next handler in the chain) + any extra arguments and returns a handler (function), which will accept a request and return a response.

@diegogub
diegogub / list-deps.cr
Created August 28, 2018 11:52 — forked from bcardiff/list-deps.cr
List binary dependencies to build a minimal docker image from scratch
unless ARGV.size > 0
puts " Missing executable file argument"
puts " Usage (in a Dockerfile)"
puts " RUN crystal run ./path/to/list-deps.cr -- ./bin/executable"
exit 1
end
executable = File.expand_path(ARGV[0])
unless File.exists?(executable)