Skip to content

Instantly share code, notes, and snippets.

View jonasporto's full-sized avatar
⌨️
Working and having fun!

Jonas Porto jonasporto

⌨️
Working and having fun!
  • Rio de Janeiro, Brazil
View GitHub Profile
@jonasporto
jonasporto / MySQL_macOS_Sierra.md
Created May 21, 2017 09:27 — forked from nrollr/MySQL_macOS_Sierra.md
Install MySQL on Sierra using Homebrew

Install MySQL on macOS Sierra

This procedure explains how to install MySQL using Homebrew on macOS Sierra 10.12

Install Homebrew

  • Installing Homebrew is effortless, open Terminal and enter :
    $ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
  • Note: Homebrew will download and install Command Line Tools for Xcode 8.0 as part of the installation process.

Install MySQL

At this time of writing, Homebrew has MySQL version 5.7.15 as default formulae in its main repository :

@jonasporto
jonasporto / heredoc-function.php
Created May 8, 2017 13:47 — forked from Pephers/heredoc-function.php
How to call a PHP function inside a Heredoc.
<?php
$cb = function ($fn) {
return $fn;
};
echo <<<HEREDOC
Hello, {$cb(ucfirst('world'))}
HEREDOC;
@jonasporto
jonasporto / upgrade-postgres-9.3-to-9.5.md
Created March 24, 2017 16:51 — forked from johanndt/upgrade-postgres-9.3-to-9.5.md
Upgrading PostgreSQL from 9.3 to 9.5 on Ubuntu

TL;DR

Install Postgres 9.5, and then:

sudo pg_dropcluster 9.5 main --stop
sudo pg_upgradecluster 9.3 main
sudo pg_dropcluster 9.3 main

Deploy DevOps

Este gist é um exercício para avaliar suas skills tecnicas para nosso processo seletivo de DevOps.

O desafio consiste em construir um ambiente Vagrant ou deploy em algum servidor composto por

A solução deve conter:

  • Load Balancer
  • 2 Servidores de aplicação
@jonasporto
jonasporto / install_elixir.md
Created October 30, 2016 16:00 — forked from rubencaro/install_elixir.md
Elixir installation guide

Elixir installation guide

Version numbers should be the ones you want. Here I do it with the last ones available at the moment of writing.

The simplest way to install elixir is using your package manager. Sadly, at the time of writing only Fedora shows the intention to keep its packages up to date. There you can simply sudo dnf install erlang elixir and you are good to go.

Anyway, if you intend to work with several versions of erlang or elixir at the same time, or you are tied to a specific version, you will need to compile it yourself. Then kerl and exenv are your best friends.

@jonasporto
jonasporto / ch1.md
Created October 30, 2016 15:01 — forked from dwayne/ch1.md
My notes from the book "Crafting Rails 4 Applications by José Valim"

Chapter 1 - Creating Our Own Renderer

Rails provides an API that we can use to create our own renderers. In this chapter we explore the API as we modify the render() method to accept :pdf as an option and return a PDF created with Prawn.

To create a new plugin just run the following:

$ rails plugin new my_plugin

TODO Complete notes

@jonasporto
jonasporto / bash-history-to-zsh-history.py
Created October 6, 2016 14:06 — forked from op/bash-history-to-zsh-history.py
Bash history to Zsh history
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# This is how I used it:
# $ cat ~/.bash_history | bash-history-to-zsh-history >> ~/.zsh_history
import sys
def main():

tmux cheatsheet

As configured in my dotfiles.

start new:

tmux

start new with session name:

@jonasporto
jonasporto / debug_httparty_request.rb
Created October 1, 2016 16:32 — forked from natritmeyer/debug_httparty_request.rb
How to debug HTTParty requests
class MyResource
include HTTParty
debug_output $stdout # <= will spit out all request details to the console
#...
end