Skip to content

Instantly share code, notes, and snippets.

@RobertAKARobin
RobertAKARobin / python.md
Last active April 18, 2024 20:44
Python Is Not A Great Programming Language
@Brachamul
Brachamul / command
Created December 26, 2016 11:40
Set an existing user to superuser using Django shell
python manage.py shell
// Correct Way
function indexOf(str, query) {
for(var i = 0; i < str.length; i++) {
for(var q = 0; q < query.length; q++) {
if (str[i+q] !== query[q]) {
break;
}
if (q === query.length - 1) {
return i;
}
@Kartones
Kartones / postgres-cheatsheet.md
Last active May 3, 2024 13:42
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)
@joyrexus
joyrexus / README.md
Last active May 3, 2024 10:41 — forked from liamcurry/gist:2597326
Vanilla JS equivalents of jQuery methods

Sans jQuery

Events

// jQuery
$(document).ready(function() {
  // code
})