Skip to content

Instantly share code, notes, and snippets.

View doug4j's full-sized avatar

Doug Johnson doug4j

View GitHub Profile
@Kartones
Kartones / postgres-cheatsheet.md
Last active July 23, 2024 09:14
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)
  • 🎨 when improving the format/structure of the code
  • 🚀 when improving performance
  • ✏️ when writing docs
  • 💡 new idea
  • 🚧 work in progress
  • ➕ when adding feature
  • ➖ when removing feature
  • 🔈 when adding logging
  • 🔇 when reducing logging
  • 🐛 when fixing a bug
@lippling
lippling / simulators.sh
Created September 23, 2014 13:17
Show installed iOS Simulators (Xcode 6+)
find ~/Library/Developer/CoreSimulator/Devices/ -name device.plist -exec sh -c "/usr/libexec/PlistBuddy -c \"print UDID\" '{}' | tr '\n' ' '" \; -exec sh -c "/usr/libexec/PlistBuddy -c \"print name\" '{}' | tr '\n' ' '" \; -exec sh -c "/usr/libexec/PlistBuddy -c \"print runtime\" '{}' | sed -n 's/com\.apple\.CoreSimulator.SimRuntime\.\(.*\)/\1/p'" \;
@maximilian-lindsey
maximilian-lindsey / sqlite3_electron_windows_integration.md
Last active August 29, 2021 14:55
SQLite3 Electron windows integration

SQLite3 Electron windows integration

This guide is based on the very informative discussion in this article: Using node_sqlite3 with Electron

Install sqlite3

npm install sqlite3 --save
@sosedoff
sosedoff / 1_simple.go
Created July 16, 2016 18:45
Golang Custom Struct Tags Example
package main
import (
"fmt"
"reflect"
)
// Name of the struct tag used in examples
const tagName = "validate"
@rtfb
rtfb / main.go
Created July 28, 2017 19:36
A complete example of a custom Blackfriday v2 renderer with pygmentizing CodeBlock handler
package main
import (
"fmt"
"io"
"os/exec"
bf "gopkg.in/russross/blackfriday.v2"
)
@sebsto
sebsto / gist:6441df09e97c4cbbd22b8ba313b8d642
Last active July 19, 2022 03:26
Amazon Linux 2 first boot on Virtual Box
# Download the VDI from https://cdn.amazonlinux.com/os-images/latest/
# Doc is at http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/amazon-linux-2-virtual-machine.html
# Be sure you have config/meta-data and config/user-data ready as per the below
# change ec2-user's password to your password
$ cat config/meta-data
local-hostname: amazonlinux.onprem
# eth0 is the default network interface enabled in the image. You can configure