Skip to content

Instantly share code, notes, and snippets.

View oviniciusfeitosa's full-sized avatar
🧛

Vinícius Feitosa da Silva oviniciusfeitosa

🧛
View GitHub Profile
@oviniciusfeitosa
oviniciusfeitosa / English
Last active October 19, 2015 13:58
[ FIX ] After upgrade to Windows 10 + Vagrant + VirtualBox > Vagrant TTY
$ vagrant up
# After run 'vagrant up', if you have problems after upgrade
# to Windows 10 OS, maybe that solution will serve.
# Use this command to return your utsname struct
# and verify your version
$ uname -s # MINGW64_NT-10.0
@oviniciusfeitosa
oviniciusfeitosa / Module.php
Created October 30, 2015 01:18
[FIXED] ZF2 invokable ServiceNotFoundException Error
// Se você está tentando registrar um invokable e obteve um erro lançado por uma exception "ServiceNotFoundException" informando que sua classe não foi encontrada, não se preocupe eu tenho a solução para esse problema.
# If you are trying to register an invokable and got an error thrown by an exception "ServiceNotFoundException" stating that her class was not found, do not worry I have the solution to this problem.
// Utilizemos o código abaixo como referência:
# Lets use the code below for reference:
/**
* Register View Helper
*/
public function getViewHelperConfig() {
return array(
@oviniciusfeitosa
oviniciusfeitosa / gist:7b95896c2b0eafb25534
Created December 4, 2015 13:10
Ir para próxima ocorrência Sublime
CTRL+D
@oviniciusfeitosa
oviniciusfeitosa / gist:632154d55b8148fb933a
Created December 8, 2015 16:48
Ótima ferramenta online gratuita para criar MindMaps com integração com Google Drive e outros sistemas
https://www.mindmup.com/
@oviniciusfeitosa
oviniciusfeitosa / gist:2f960f5e14592c2a6515
Created December 11, 2015 18:01
Concatenar arquivos em um único
echo -e "$(cat $ARQ1 $ARQ2 $ARQ3)" >> $ARQ_FINAL
FONTE: http://www.vivaolinux.com.br/topico/Comandos/Quebra-de-linha-3
@oviniciusfeitosa
oviniciusfeitosa / gist:908c14c6f0177cba37fc
Created December 11, 2015 18:12
Continuação de linha - Bash
Uma linha pode ser quebrada em várias, desde que elas terminem com um '\'.
printf "$format" \
Chair 79,95 4 319,8 \
Table 209,99 1 209,99 \
Armchair 315,49 2 630,98
FONTE: http://gamontbr.blogspot.com.br/2011/07/bash-continuacao-de-linha.html
@oviniciusfeitosa
oviniciusfeitosa / gist:834b399d82baa4b5ed93
Last active December 11, 2015 18:15
Diferença entre sobrescrever e adicionar conteúdo ao final do arquivo
A little understanding of how *nix pipes work would help.
In short the '>>' pipe operator will append lines to the end of the specified file, where-as the single greater than '>' will empty and overwrite the file.
echo "text" > 'Users/Name/Desktop/TheAccount.txt'
FONTE: http://stackoverflow.com/questions/4676459/write-to-file-but-overwrite-it-if-it-exists
@oviniciusfeitosa
oviniciusfeitosa / createDynamicVirtualHost.sh
Created December 14, 2015 20:01
Create dynamic VirtualHost - Apache2 | Useful for Vagrant provision
# Português
# Tem como responsabilidade criar e ativar um VirtualHost no Apache2 dinamicamente. Muito útil para quem utiliza Vagrant e procura uma maneira mais simples para criar VirtualHosts .
# Como vários frameworks PHP, como ZendFramework 2, seguem uma estrutura parecida para que os arquivos .htaccess funcionem corretamente, essa é uma alternativa simples e que pode ser integrada com outras ferramentas.
# English
# It has the responsibility to create and activate a VirtualHost in Apache 2 dynamically. Very useful for those using Vagrant and seeks a simpler way to create VirtualHosts.
# How many PHP frameworks, as ZendFramework 2, follow a similar structure to that .htaccess files work correctly, this is a simple alternative that can be integrated with other tools.
# Parameters:
@oviniciusfeitosa
oviniciusfeitosa / PVC.md
Created December 14, 2015 20:02
PVC( Padrão de versionamento de código )

PVC( Padrão de versionamento de código ) Para que haja maior organização dos arquivos que são versionados no repositório, devemos inserir comentários precedidos pelas ações que foram executadas nos arquivos versionados. Portanto, decidi criar um padrão de versionamento de código para que fique mais flexivel identificar o que foi realizado nos commits.

Como padrão, deve ser colocado entre coxetes e caixa alta, o tipo de ação utilizada para versionar um ou mais arquivos, podendo ser utilizada mais de uma ação no versionamento do código e logo após um breve comentário do que foi realizado.

Lista de ações adotar o padrão abaixo:

  • [ADD] ­ Adição de novos arquivos no projeto;

  • [REMOVE] ­ Utilizado para sinalizar a remoção de arquivos;

@oviniciusfeitosa
oviniciusfeitosa / mysql.sql
Created December 21, 2015 12:37
Create MySQL User, password and privileges
CREATE USER 'username'@'yourhost' IDENTIFIED BY 'yourpassword';
GRANT ALL PRIVILEGES ON yourDatabase.* TO 'username'@'yourhost';
# DONE! ;)