Navigation Menu

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 / bash_functions
Created February 11, 2014 00:07
dotfiles - bash functions
#!/bin/bash
#
# General
# ---------------------------------------------------
# Create a data URI from a file
datauri() {
local mimeType=""
@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 / responsive-test.md
Last active December 20, 2015 17:39
Teste para projetos responsivos - Método para capturar telas utilizando o PhantomJS.

Teste para projetos responsivos

Problema

Testar/verificar a disposição dos elementos de uma determinada página em determinadas resoluções de tela.

Solução

Executar captura de telas de acordo com os viewports definidos em um script, com a ajuda do PhantomJS.

Necessário ter o NodeJS instalado.

@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

@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 / node-modules.md
Last active July 29, 2016 11:18
Install all node modules on my workflow

Workflow - Install Node modules

$ npm i -g
grunt-cli gulp-cli
jshint jscs clean-css eslint babel-eslint uncss
babel
nodemon pm2 browser-sync
@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 / 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 / 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