Skip to content

Instantly share code, notes, and snippets.

View url-encode.lua
local char_to_hex = function(c)
return string.format("%%%02X", string.byte(c))
end
local function urlencode(url)
if url == nil then
return
end
url = url:gsub("\n", "\r\n")
url = url:gsub("([^%w ])", char_to_hex)
View getgist
#!/usr/bin/env bash
if [[ "$1" =~ ^[0-9]+ ]]; then
curl -L "http://gist.github.com/$1/download" | tar zx --strip-components 1
exit 0
fi
curl -L "$1/download" | tar zx --strip-components 1
You can’t perform that action at this time.