Skip to content

Instantly share code, notes, and snippets.

View haroldofurtado's full-sized avatar

Haroldo Furtado haroldofurtado

View GitHub Profile
@haroldofurtado
haroldofurtado / bash_strict_mode.md
Created August 24, 2022 11:50 — forked from vncsna/bash_strict_mode.md
set -e, -u, -o, -x pipefail explanation

set -e, -u, -o, -x pipefail

The set lines

  • These lines deliberately cause your script to fail. Wait, what? Believe me, this is a good thing.
  • With these settings, certain common errors will cause the script to immediately fail, explicitly and loudly. Otherwise, you can get hidden bugs that are discovered only when they blow up in production.
  • set -euxo pipefail is short for:
set -e
set -u
@haroldofurtado
haroldofurtado / 01_metodos_de_instancia.rb
Created October 26, 2020 21:24 — forked from serradura/01_metodos_de_instancia.rb
Ruby - Métodos de instância VS de classe VS lambda
class Calc
def sum(a, b)
a + b
end
def multiply(a, b)
a * b
end
end
@haroldofurtado
haroldofurtado / ubuntu20.md
Last active August 3, 2020 09:53 — forked from brycejohnston/ubuntu20.md
Ubuntu 20.04 Ruby and Elixir Development Setup

Ubuntu 20.04 Ruby and Elixir (and Misc) Development Setup

Guide to setting up a new Ubuntu 20.04 dev environment with Ruby, Elixir and Node.js installed with the asdf version management tool along with PostgreSQL & PostGIS.

Update system and install prerequisite packages

Some of these packages may already be installed

sudo apt-get install autoconf automake binutils build-essential curl \
 dirmngr dnsutils fonts-liberation fonts-liberation2 fontconfig g++ gcc gdal-bin git \
@haroldofurtado
haroldofurtado / rails_setup.md
Created February 27, 2020 16:40 — forked from ryanflach/rails_setup.md
Common setup for a new Rails project
  1. rails new <project_name> -d postgresql --skip-turbolinks --skip-spring -T
  • -d postgresql sets up the project to use PostgreSQL
  • --skip-turbolinks & --skip-spring creates a project that does not use turbolinks or spring
  • -T skips the creation of the test directory and use of Test::Unit
  1. In the Gemfile:
  • Available to all environments:
    • gem 'figaro' - store environment variables securely across your app (docs)
    • Uncomment gem 'bcrypt', '~> 3.1.7' if you will be hosting your own user accounts with passwords (docs)
  • Inside of group :test:
    • gem 'rspec-rails' - user rspec in place of minitest (docs)
@haroldofurtado
haroldofurtado / .zshrc
Created March 9, 2018 08:52 — forked from zanshin/.zshrc
My .zshrc file
# Path to your oh-my-zsh configuration.
export ZSH=$HOME/.oh-my-zsh
# Set name of the theme to load.
# Look in ~/.oh-my-zsh/themes/
# Optionally, if you set this to "random", it'll load a random theme each
# time that oh-my-zsh is loaded.
#export ZSH_THEME="robbyrussell"
export ZSH_THEME="zanshin"
@haroldofurtado
haroldofurtado / VPS Config
Last active September 10, 2015 13:55 — forked from basmoura/VPS Config
VPS Config
https://www.digitalocean.com/community/articles/how-to-add-swap-on-ubuntu-12-04
sudo apt-get update
curl -L get.rvm.io | bash -s stable
source ~/.rvm/scripts/rvm
rvmsudo /usr/bin/apt-get install build-essential nodejs openssl libcurl4-openssl-dev libreadline6 libreadline6-dev curl git-core zlib1g zlib1g-dev libssl-dev libyaml-dev libsqlite3-dev sqlite3 libxml2-dev libxslt-dev autoconf libc6-dev ncurses-dev automake libtool bison