Skip to content

Instantly share code, notes, and snippets.

@Kartones
Kartones / postgres-cheatsheet.md
Last active January 8, 2026 15:01
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)
@ourmaninamsterdam
ourmaninamsterdam / gist:b2bda53a5b1ecbb2133c
Created May 7, 2014 13:57
Libary-less addClass and removeClass functions
function addClass(elem, newClass) {
var curClass = elem.className;
if(!new RegExp(newClass,'i').test(curClass)){
if(curClass.length > 0 && curClass.charAt(curClass.length) === '') {
newClass = ' ' + newClass;
}
elem.className += newClass;
}
};
@ryansmith3136
ryansmith3136 / hack-reactor.md
Last active November 24, 2022 07:01
Hack Reactor Talk

Tales From a Heroku User

Here are some things I have learned along the way.

Last Updated: 2013-02-08

Original Audience: Hack Reactor

About

@paulirish
paulirish / gist:4158604
Created November 28, 2012 02:08
Learn JavaScript concepts with recent DevTools features

Learn JavaScript concepts with the Chrome DevTools

Authored by Peter Rybin , Chrome DevTools team

In this short guide we'll review some new Chrome DevTools features for "function scope" and "internal properties" by exploring some base JavaScript language concepts.

Closures

Let's start with closures – one of the most famous things in JS. A closure is a function, that uses variables from outside. See an example:

@captn3m0
captn3m0 / LICENSE.txt
Created September 28, 2011 14:16 — forked from p01/LICENSE.txt
Sudoku Solver in 140bytes
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 Mathieu 'p01' Henri <http://www.p01.org/releases/>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE