Skip to content

Instantly share code, notes, and snippets.

View delbetu's full-sized avatar
🏠
Working from home

M. Bellucci delbetu

🏠
Working from home
View GitHub Profile
@emaraschio
emaraschio / SOLID.markdown
Last active May 24, 2023 07:18
SOLID Principles with ruby examples

#SOLID Principles with ruby examples

##SRP - Single responsibility principle A class should have only a single responsibility.

Every class should have a single responsibility, and that responsibility should be entirely encapsulated. All its services should be narrowly aligned with that responsibility, this embrace the high cohesion.

##OCP - Open/closed principle Software entities should be open for extension, but closed for modification.

@Kartones
Kartones / postgres-cheatsheet.md
Last active July 25, 2024 09:09
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)
@filipechagas
filipechagas / gist:3796109
Created September 27, 2012 19:54
Ctags on Mac Osx

http://gmarik.info/blog/2010/10/08/ctags-on-OSX

Snow Leo ships with ctags not suitable for Ruby development. Ie if you try to generate tags recursively, it will error out:

$ ctags R
ctags: illegal option -
R
usage: ctags [-BFadtuwvx] [-f tagsfile] file …

$ which ctags
/usr/bin/ctags