Skip to content

Instantly share code, notes, and snippets.

Tácio Nery thnery

  • Olinda
View GitHub Profile
# removes all docker images
docker images -aq | awk '{print $1}' | xargs docker rmi -f
# removes all docker containers
docker ps -aq | awk '{print $1}' | xargs docker rm -f
thnery / .vimrc
Last active Mar 21, 2019 — forked from henriquemenezes/.vimrc
View .vimrc
set encoding=utf-8
set nocompatible
set autoindent
set backspace=indent,eol,start
set nu
filetype off
call plug#begin('~/.vim/plugged')
Plug 'vim-syntastic/syntastic'
thnery /
Created Jul 22, 2018 — forked from Kartones/
PostgreSQL command line cheatsheet


Magic words:

psql -U postgres

Some interesting flags (to see all, use -h):

  • -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)
thnery /
Created Jun 13, 2018
Ubuntu Hadoop Install
# Ubuntu 16.04
# Configuração inicial
apt-get update
apt-get install ssh rsync
apt-get install default-jdk
# Download Hadoop
thnery / Dockerfile
Last active May 27, 2018
Dockerfile with Ruby Alpine
View Dockerfile
FROM ruby:2.4.2-alpine
ADD Gemfile /app/
ADD Gemfile.lock /app/
RUN apk add --no-cache bash gawk sed grep bc coreutils vim
RUN apk add --update ruby-dev build-base git \
libxml2-dev libxslt-dev pcre-dev libffi-dev \
RUN gem install bundler --no-ri --no-rdoc && \
thnery / sublime_config.json
Last active May 10, 2018
Sublime config file
View sublime_config.json
"auto_complete": true,
"auto_complete_commit_on_tab": true,
"color_inactive_tabs": false,
"color_scheme": "Packages/Python 3/Gloom.tmTheme",
"copy_with_empty_selection": true,
"ensure_newline_at_eof_on_save": true,
"font_size": 13,
thnery / .matplotlib
Created Mar 18, 2018
configuration file for matplotlib on mac osx
View .matplotlib
backend: TkAgg
thnery / rails-jsonb-queries.rb
Last active Oct 5, 2018 — forked from mankind/rails-jsonb-queries
Rails-5 postgresql-9.6 jsonb queries
View rails-jsonb-queries.rb
# payload: [{"kind"=>"person"}]
Segment.where("payload @> ?", [{kind: "person"}].to_json)
# data: {"interest"=>["music", "movies", "programming"]}
Segment.where("data @> ?", {"interest": ["music", "movies", "programming"]}.to_json)
Segment.where("data #>> '{interest, 1}' = 'movies' ")
Segment.where("jsonb_array_length(data->'interest') > 1")
View aws_setup.txt
AWS ECS setup
1. Create VPC
VPC Dashboard > Start VPC Wizard > VPC with a Single Public Subnet
- VPC name: <project>-<environment>
- Public Subnet:
- Availiability Zone: us-east-1a
thnery / databse_sample.yml
Created Apr 9, 2017
config/database for docker container
View databse_sample.yml
default: &default
adapter: postgresql
encoding: unicode
pool: 5
<<: *default
database: myapp_api_development
host: db
You can’t perform that action at this time.