Skip to content

Instantly share code, notes, and snippets.

How to set-up bash completion on Mac for Docker, Docker Machine and Docker-Compose

Run:

brew install bash-completion

Add the following lines to your ~/.bash_profile:

 if [ -f $(brew --prefix)/etc/bash_completion ]; then
@riccardo-felipe
riccardo-felipe / gist:aa2a61b768d6cc07adabc57991032316
Last active September 30, 2018 09:26 — forked from psayre23/gist:c30a821239f4818b0709
Runtime Complexity of Java Collections
Below are the Big O performance of common functions of different Java Collections.
List | Add | Remove | Get | Contains | Next | Data Structure
---------------------|------|--------|------|----------|------|---------------
ArrayList | O(1) | O(n) | O(1) | O(n) | O(1) | Array
LinkedList | O(1) | O(1) | O(n) | O(n) | O(1) | Linked List
CopyOnWriteArrayList | O(n) | O(n) | O(1) | O(n) | O(1) | Array
@riccardo-felipe
riccardo-felipe / postgres-import-export-csv.md
Created August 22, 2018 07:06 — forked from nepsilon/postgres-import-export-csv.md
Importing and Exporting CSV files with PostgreSQL — First published in fullweb.io issue #19

Importing and exporting CSV files with PostgreSQL

Let’s see how to use PostgreSQL to import and export CSV files painlessly with the COPY command.

Import CSV into table t_words:

COPY t_words FROM '/path/to/file.csv' DELIMITER ',' CSV;

You can tell quote char with QUOTE and change delimiter with DELIMITER.

Keybase proof

I hereby claim:

  • I am riccardo-felipe on github.
  • I am riccardof (https://keybase.io/riccardof) on keybase.
  • I have a public key ASCc6Ac0ZK0quLuusY6hkRYLzjnnUi5WkEJIa-OzYRWm_go

To claim this, I am signing this object:

@riccardo-felipe
riccardo-felipe / vim.sh
Created April 10, 2017 18:12
Compiling vim on Ubuntu 16 with LUA-support
# Remove previous installations
sudo apt-get remove vim vim-runtime vim-tiny vim-common
# Install dependencies
sudo apt-get install libncurses5-dev python-dev libperl-dev ruby-dev liblua5.2-dev
# Fix liblua paths
sudo ln -s /usr/include/lua5.2 /usr/include/lua
sudo ln -s /usr/lib/x86_64-linux-gnu/liblua5.2.so /usr/local/lib/liblua.so