Skip to content

Instantly share code, notes, and snippets.

View wwwbruno's full-sized avatar

Bruno Almeida wwwbruno

View GitHub Profile
@wwwbruno
wwwbruno / pomodoro.sh
Last active August 29, 2015 14:13
Pomodoro Shell script
#!/bin/sh
#
# Pomodoro script.
#
# Displays an alert after 25 minutes job / 5 minutes pause.
#
# Shell script for a simple Pomodoro technic
#
# Author: Bruno Almeida <[email protected]>
@wwwbruno
wwwbruno / .gitconfig
Last active August 29, 2015 14:13
My .gitconfig
# ~/.gitconfig
[core]
fileMode = false
[user]
email = [email protected]
name = Bruno Almeida
[alias]
lg = log --pretty=format:'%Cblue%h | %Cred%ad | %C(yellow)%an | %Cgreen%d %Creset%s' --date=short
st = !git lg -10 && git branch && git status
pom = push origin master
@wwwbruno
wwwbruno / migration51_pt_BR.patch
Created December 13, 2014 18:59
PHP Migration 51 tranlation ptBR
Index: /home/wwwbruno/translation_fest/doc-pt_BR/pt_BR/appendices/migration51.xml
===================================================================
--- /home/wwwbruno/translation_fest/doc-pt_BR/pt_BR/appendices/migration51.xml (revision 0)
+++ /home/wwwbruno/translation_fest/doc-pt_BR/pt_BR/appendices/migration51.xml (working copy)
@@ -0,0 +1,766 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- EN-Revision: 334587 Maintainer: none Status: ready --><!-- CREDITS: [email protected], [email protected] -->
+<appendix xml:id="migration51" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
+ <title>Migrando do PHP 5.0.x para PHP 5.1.x</title>
+ <para>
@wwwbruno
wwwbruno / git-flow.sh
Created November 12, 2014 10:06
Ordem cronológica básica do git
# Atualizar meu repositório local
git pull origin master
# Faço as alterações necessárias no código
# Verifico o que foi modificado
git status (opcional)
# Caso precise de mais detalhes
git diff (opcional)
# Reference https://github.com/globalize/globalize
# To create new records when using Globalize
# to enter in rails console
rails c
# set the locale to English
I18n.locale = :en
@wwwbruno
wwwbruno / symfony_controller.php
Last active August 29, 2015 14:07
Symfony useful code
# Get doctrine entity manager
$em = $this->getDoctrine()->getManager();
# Get repository
$user = $em->getRepository('AcmeAdminBundle:User')->find($id);
# Get logged user
$this->getUser();
@wwwbruno
wwwbruno / .htaccess
Created September 26, 2014 17:17
Redirecionamento para subdomínios de produção e teste para servidor apache
RewriteEngine on
# Redirecionamento para o subdominio de producao
RewriteCond %{HTTP_HOST} ^site.com.br$ [NC,OR]
RewriteCond %{HTTP_HOST} ^www.site.com.br$
RewriteCond %{REQUEST_URI} !site/
RewriteRule (.*) site/$1 [L]
# Redirecionamento para o subdominio de teste
RewriteCond %{HTTP_HOST} ^teste.site.com.br$
@wwwbruno
wwwbruno / .gitignore
Created August 18, 2014 12:23
.gitignore file for Symfony2 Framework
# Cache, logs, sessions and spool
/app/cache/*
/app/logs/*
/app/sessions/*
/app/spool/*
!app/cache/.gitkeep
!app/logs/.gitkeep
!app/sessions/.gitkeep
!app/spool/.gitkeep
@wwwbruno
wwwbruno / how-to-use-gulp.txt
Last active August 29, 2015 14:05
Simple way to use gulp
# install npm
sudo apt-get install npm
# install gulp globally
sudo npm install -g gulp
# go to your project directory
cd project
# install gulp dependencies for your dev project
@wwwbruno
wwwbruno / svn-git.sh
Created August 7, 2014 17:54
Using git with svn
# installing on Ubuntu
sudo add-apt-repository ppa:git-core/ppa
apt-get update
sudo apt-get install git-svn