Skip to content

Instantly share code, notes, and snippets.

View crashtech's full-sized avatar
🛰️
Creating magic method by method

Carlos crashtech

🛰️
Creating magic method by method
View GitHub Profile
@apolloclark
apolloclark / postgres cheatsheet.md
Last active June 3, 2024 10:34
postgres cheatsheet

Postgres Cheatsheet

This is a collection of the most common commands I run while administering Postgres databases. The variables shown between the open and closed tags, "<" and ">", should be replaced with a name you choose. Postgres has multiple shortcut functions, starting with a forward slash, "". Any SQL command that is not a shortcut, must end with a semicolon, ";". You can use the keyboard UP and DOWN keys to scroll the history of previous commands you've run.

Setup

installation, Ubuntu

http://www.postgresql.org/download/linux/ubuntu/ https://help.ubuntu.com/community/PostgreSQL

@nbrew
nbrew / YodaSpeak.rb
Created August 10, 2010 22:53 — forked from LeipeLeon/YodaSpeak.rb
YodaSpeak translator in ruby with added pivot words
# port of http://www.perlmonks.org/?node_id=162190
#
# Please refactor this if necessary
# leonb -at- beriedata -dot- nl
#
class String
def yoda
word = %w{is be will show do try are teach have look help see can learn has}.select { |word| self =~ /\b#{word}\b/ }[0]
if word
x = (self =~ /\b#{word}\b/) + word.size