Skip to content

Instantly share code, notes, and snippets.

Função Retorno Variável dentro do escopo Uso
Let Unit/Lambda* it Funções com chamadas encadeadas e checagem de objetos nulos
Run Unit/Lambda* this Inicialização do objeto e o cálculo do valor de retorno
With Unit/Lambda* this Executar funções no objeto dentro de um contexto.
Apply Objeto this Inicializar e configurar um objeto
Also Objeto it Ações adicionais que não alteram o objeto
#Para quem tem que deletar muita msg das dead_queue,
#e tem que selecionar uma a uma quais msg deseja excluir.
#Seus problemas acabaram! abra a fila clique em visualizar e buscar e no console cole isso:
function find_and_delete(to_find){
$("div[style='overflow:hidden;white-space:nowrap;']").each(function( index ) {
var text_to_validate = $(this).text()
var n = text_to_validate.search(to_find);
if (n > 0){
@beatrizuezu
beatrizuezu / installing-node-with-nvm.md
Created August 8, 2019 17:36 — forked from d2s/installing-node-with-nvm.md
Installing Node.js to Linux & macOS & WSL with nvm
@beatrizuezu
beatrizuezu / postgres-cheatsheet.md
Last active January 24, 2019 12:24 — 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)
git clone https://github.com/pyenv/pyenv.git ~/.pyenv
or these commands for Mac
brew update
brew install pyenv
echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.zshrc
echo 'export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.zshrc
echo -e 'if command -v pyenv 1>/dev/null 2>&1; then\n eval "$(pyenv init -)"\nfi' >> ~/.zshrc
@beatrizuezu
beatrizuezu / atom-packages-python.txt
Last active April 5, 2021 01:46
Python Packages for Atom
https://atom.io/packages/file-icons
https://atom.io/packages/minimap
https://atom.io/packages/linter
https://atom.io/packages/busy-signal
https://atom.io/packages/highlight-selected
https://atom.io/packages/sublime-style-column-selection
https://atom.io/packages/terminus
https://atom.io/packages/rainbow-csv
# Dist .sh initial
sudo apt-get install curl build-essential openssl libreadline6 libreadline6-dev git-core zlib1g zlib1g-dev libssl-dev libyaml-dev libsqlite3-dev sqlite3 libxml2-dev libxslt-dev autoconf libc6-dev ncurses-dev automake libtool bison
# get rvm
curl -sSL https://rvm.io/mpapis.asc | gpg --import -
curl -L https://get.rvm.io | bash -s stable
source ~/.rvm/scripts/rvm
rvm requirements
# install last ruby version
@beatrizuezu
beatrizuezu / config virtualevwrapper
Created May 29, 2018 18:36
config virtualevwrapper on bashrc or zshrc
#set where virutal environments will live
export WORKON_HOME=$HOME/.Envs
# ensure all new environments are isolated from the site-packages directory
export VIRTUALENVWRAPPER_VIRTUALENV_ARGS='--no-site-packages'
# use the same directory for virtualenvs as virtualenvwrapper
export PIP_VIRTUALENV_BASE=$WORKON_HOME
# makes pip detect an active virtualenv and install to it
export PIP_RESPECT_VIRTUALENV=true
if [[ -r /usr/local/bin/virtualenvwrapper.sh ]]; then
source /usr/local/bin/virtualenvwrapper.sh
@beatrizuezu
beatrizuezu / settings.py
Created August 7, 2017 02:37
De SQL para ORM Django / settings logger
...
LOGGING = {
'version': 1,
'disable_existing_loggers': False,
'handlers': {
'console': {
'class': 'logging.StreamHandler',
},
},
@beatrizuezu
beatrizuezu / desc-produto.sql
Created August 6, 2017 17:30
De SQL para ORM Django / desc produtos_produto
mysql> desc produtos_produto;
+--------------+---------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+--------------+---------------+------+-----+---------+----------------+
| id | int(11) | NO | PRI | NULL | auto_increment |
| nome | varchar(128) | NO | | NULL | |
| valor | decimal(10,2) | YES | | NULL | |
| categoria_id | int(11) | NO | MUL | NULL | |
+--------------+---------------+------+-----+---------+----------------+