Skip to content

Instantly share code, notes, and snippets.

View vitorbritto's full-sized avatar
🏠
Working from home

Vitor Britto vitorbritto

🏠
Working from home
View GitHub Profile
@vitorbritto
vitorbritto / build.sh
Created July 6, 2016 12:33
Prepare and compile files using Shell Script
#!/bin/bash
#
 # Programa: build.sh
 # Autor: Vitor Britto
 #
 # Descrição:
 # Este script será responsável pelo build do projeto, o qual
 # fará o processo de minificação e concatenação dos arquivos
 # e preparação dos arquivos a serem colocados em produção.
@vitorbritto
vitorbritto / scaffolding.sh
Created July 6, 2016 12:30
Scaffolding for a new project using Shell Script
#!/bin/bash
#
 # Programa: scaffolding.sh
 # Autor: Vitor Britto
 #
 # Descrição:
 # Este script será responsável pela criação
 # de uma estrutura para novos projetos.
 #
@vitorbritto
vitorbritto / rake_cli.md
Last active August 29, 2015 14:14
Rake CLI

Rake CLI

  • db:create creates the database for the current env
  • db:create:all creates the databases for all envs
  • db:drop drops the database for the current env
  • db:drop:all drops the databases for all envs
  • db:migrate runs migrations for the current env that have not run yet
  • db:migrate:up runs one specific migration
  • db:migrate:down rolls back one specific migration
  • db:migrate:status shows current migration status
@vitorbritto
vitorbritto / add_wp_cli.md
Created January 24, 2015 17:44
Install WordPress CLI

Install WordPress CLI

# Installing WordPress CLI

curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar
php wp-cli.phar --info
chmod +x wp-cli.phar
mv wp-cli.phar /usr/local/bin/wp

Installing WordPress Bash Completions

@vitorbritto
vitorbritto / add_php_brew.md
Last active September 26, 2018 14:19
Install PHP with HomeBrew

Install PHP with HomeBrew

Complete Guide / Isseus / Common Problems: https://github.com/Homebrew/homebrew-php

Installing PHP 5.6

# Install PHP with PHP-FPM and excluding snmp
brew install -v homebrew/php/php56 --with-fpm --without-snmp

Setting up PHP 5.6

@vitorbritto
vitorbritto / add_apache_brew.md
Last active March 4, 2019 10:30
Install Apache with Homebrew

Install Apache with Homebrew

Installing Apache

# Start by stopping the built-in Apache, if it's running, and prevent it from starting on boot.
# This is one of very few times you'll need to use sudo:
sudo launchctl unload /System/Library/LaunchDaemons/org.apache.httpd.plist 2>/dev/null

# We need to tap homebrew-dupes because "homebrew-apache/httpd22" relies on "homebrew-dupes/zlib"

and install Apache 2.2 with the event MPM, and we'll use Homebrew's OpenSSL library

@vitorbritto
vitorbritto / add_mysql_brew.md
Created January 24, 2015 17:10
Install MySQL with HomeBrew

Install MySQL with HomeBrew

# Installing MySQL

brew install -v mysql

# Setting up MySQL

# Copy the default my-default.cnf file to the MySQL Homebrew Cellar

directory where it will be loaded on application start:

@vitorbritto
vitorbritto / rm_mysql.md
Last active April 23, 2024 14:21
Remove MySQL completely from Mac OSX

Remove MySQL completely

  1. Open the Terminal

  2. Use mysqldump to backup your databases

  3. Check for MySQL processes with: ps -ax | grep mysql

  4. Stop and kill any MySQL processes

  5. Analyze MySQL on HomeBrew:

    brew remove mysql
    
@vitorbritto
vitorbritto / regex.md
Last active May 2, 2024 13:24
Regex Cheat Sheet

Regular Expressions

Basic Syntax

  • /.../: Start and end regex delimiters
  • |: Alternation
  • (): Grouping
@vitorbritto
vitorbritto / commands.md
Last active June 9, 2016 12:44
Unix References

Unix Commands

Environment Control

cd d                         Change to directory d
mkdir d                      Create new directory d
rmdir d                      Remove directory d
mv f1 [f2...] d              Move file f to directory d
mv d1 d2                     Rename directory d1 as d2

passwd Change password