Skip to content

Instantly share code, notes, and snippets.

View guipdutra's full-sized avatar

Guilherme Dutra guipdutra

View GitHub Profile
@guipdutra
guipdutra / postgres-cheatsheet.md
Created May 14, 2019 19:34 — forked from Kartones/postgres-cheatsheet.md
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)
(ns tweet_linkz.core
(:use
[twitter.oauth]
[twitter.callbacks]
[twitter.callbacks.handlers]
[twitter.api.restful])
(:import
(twitter.callbacks.protocols SyncSingleCallback)))
9-12.30am
4.10am nap
8.10am nap
2.40pm nap
(defn next-item [array elem]
(get (into-array array) (inc (.indexOf array elem))))
(fact "next-item"
(next-item (range 1 25) 12) => 13
(next-item [:a :b :c] :b) => :c)
require 'koala'
require 'httpclient'
require 'json'
class Event
def initialize params
@id = params[:id]
@graph = Koala::Facebook::API.new('CAACEdEose0cBAJGfwNoDHG676ZCvkxX08jcVqYxVqjZABJEL2hoNvSgWQIZCmizoRGD65uWxek6KGzLpGmuZBvGGXwtIXHTSlZC6EUdqLfgYcMiBY75z2WbFvvJR09LT0EEg03CVECU83kbQiLcG3yTCZBFk3JBg1cUCfl8BcbZAcHekN7Q9SmJkH2EtztQZBw6XTEG4kQkd27Klrz7FbAxT')
end
require 'koala'
require 'httpclient'
require 'json'
class Event
def initialize params
@id = params[:id]
@graph = Koala::Facebook::API.new('CAACEdEose0cBACFZAz8GA45hmXCy6s0spYUbMCHsfZAcoe6UANu5ZAYJmr7DzNZCLO8aL8rZB6gjbNRzvFg5oD9PIsjVjKK3IXDmRcaesgOm0GSqGtye87pC6fjPz7WseSgI4VU8Sids7IwQrUphHkGbZAvAPj7wO5IEOeKbyv03giFvAKYJWrvonwJOCB9WMzNW1EFVQGGEPfhEFeuuS9')
end
require 'koala'
require 'httpclient'
require 'json'
class Event
def initialize params
@id = params[:id]
@graph = Koala::Facebook::API.new('CAACEdEose0cBANQRADTYIXfbGoQaL7Fv0dheFWAxBsiemgghsACX7qkfVnvRLNGwrF0NTNxUPZBrxGXtgVZCF67yEGPiwZCgIL4cWNEY9o5Itr8cIzqTbOnyM7pBUwiFzUj5Iq62ImXPVRZAEgXo39Rvy2U4JUA3q7RNofm6DRIo9QDmJ1eFc0JqnoV2YYmN9ZBjU26ruXrBUqi9EAkoH')
end
- => Things to do to learn the subject
* => Tasks to complete these things
_ok_ => Tasks completed
CH => Chapter
Functional Programming
- Read book Programming Clojure
* End to read the chapter 4.
* Read CH 5
* Read CH 6
class UrlParser
ID_SEPARATOR = "&TB_iframe"
ID_REGEX = /\d+#{Regexp.quote(ID_SEPARATOR)}/
def parse_party_id(url)
url[ID_REGEX][/\d+/]
end
end
@guipdutra
guipdutra / gist:cd0aaf7ac3cd8ee22daa
Created September 29, 2014 19:38
Telefone Cabelereiro POA
Cabelo e Cia - (51) 3336.7768