Skip to content

Instantly share code, notes, and snippets.

@stewsters
stewsters / Slack message
Last active September 17, 2020 01:29
This sends messages as slackbot to slack
/**
* This sends messages as slackbot to slack using groovy
*/
String.metaClass.encodeURL = {
java.net.URLEncoder.encode(delegate, "UTF-8")
}
def address = "https://slack.com/api/"
def method = "chat.postMessage"
@Kartones
Kartones / postgres-cheatsheet.md
Last active May 24, 2025 15:52
PostgreSQL command line cheatsheet

PSQL

Magic words:

psql -U postgres

Some interesting flags (to see all, use -h or --help depending on your psql version):

  • -E: will describe the underlaying queries of the \ commands (cool for learning!)
  • -l: psql will list all databases and then exit (useful if the user you connect with doesn't has a default database, like at AWS RDS)
@dergachev
dergachev / GIF-Screencast-OSX.md
Last active April 28, 2025 00:02
OS X Screencast to animated GIF

OS X Screencast to animated GIF

This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.

Screencapture GIF

Instructions

To capture the video (filesize: 19MB), using the free "QuickTime Player" application:

@cdown
cdown / gist:1163649
Last active April 14, 2025 22:42
Bash urlencode and urldecode
urlencode() {
# urlencode <string>
old_lc_collate=$LC_COLLATE
LC_COLLATE=C
local length="${#1}"
for (( i = 0; i < length; i++ )); do
local c="${1:$i:1}"
case $c in