Skip to content

Instantly share code, notes, and snippets.

View halcyondude's full-sized avatar
🖖

Matt Young halcyondude

🖖
View GitHub Profile
@Kartones
Kartones / postgres-cheatsheet.md
Last active July 23, 2025 17:36
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)
@dmitshur
dmitshur / gist:6927554
Last active December 29, 2024 12:06
[Legacy GOPATH mode] How to `go get` private repos using SSH key auth instead of password auth.
@masak
masak / explanation.md
Last active June 19, 2025 13:01
How is git commit sha1 formed

Ok, I geeked out, and this is probably more information than you need. But it completely answers the question. Sorry. ☺

Locally, I'm at this commit:

$ git show
commit d6cd1e2bd19e03a81132a23b2025920577f84e37
Author: jnthn <[email protected]>
Date:   Sun Apr 15 16:35:03 2012 +0200

When I added FIRST/NEXT/LAST, it was idiomatic but not quite so fast. This makes it faster. Another little bit of masak++'s program.

@nduhamel
nduhamel / readonlydict.py
Created December 20, 2010 20:48
Simple Read-only dict python
import UserDict
class ReadOnlyDict(UserDict.IterableUserDict):
def __setitem__(self, key, item): raise TypeError
def __delitem__(self, key): raise TypeError
def clear(self): raise TypeError
def pop(self, key, *args): raise TypeError
def popitem(self): raise TypeError
def update(self, dict=None):