Skip to content

Instantly share code, notes, and snippets.

View wwwbruno's full-sized avatar

Bruno Almeida wwwbruno

View GitHub Profile
@wwwbruno
wwwbruno / update_rails_server.sh
Last active August 29, 2015 13:57
Comandos básicos para update de uma aplicação em Rails em servidor com ngix/unicorn
# atualiza o repositório
git pull
# atualiza os bundles
bundle install
# precomplia os assets
RAILS_ENV=production rake assets:precompile
# atualiza o banco de dados
# Atualizar servidor Symfony
# Atualiza o repositório
$ svn up # ou git pull
# Atualiza o banco de dados
$ php app/console doctrine:schema:update --force
# Dá permissão de leitura para o app_dev.php
$ chmod +r web/app_dev.php
@wwwbruno
wwwbruno / TwitterAPIExchange.php
Last active August 29, 2015 13:58
Twitter API for PHP
<?php
/**
* Twitter-API-PHP : Simple PHP wrapper for the v1.1 API
*
* PHP version 5.3.10
*
* @category Awesomeness
* @package Twitter-API-PHP
* @author James Mallison <me@j7mbo.co.uk>
@wwwbruno
wwwbruno / crontab.sh
Created April 15, 2014 11:55
Uso básico do crontab
# Edita o arquivo atual do crontab ou cria um se não existir
crontab -e
# Exibe o conteúdo atual do crontab
crontab -l
# Remove o arquivo atual do crontab
crontab -r
@wwwbruno
wwwbruno / ruby_utils.sh
Created May 11, 2014 14:16
Utilidades para Ruby on Rails
# Instalar mysql para Ruby on Rails
sudo apt-get install libmysqlclient-dev
gem install mysql2
# Instalar pg para Ruby on Rails
sudo apt-get install libpq-dev
gem install pg
@wwwbruno
wwwbruno / git-basic.sh
Last active June 29, 2016 08:10
Git basic commands
# HELP
git help
git help config # get help for config command
git help commit # get help for commit command
# BASICS
git init # starts a new git repo
# FILES AND STAGE
# status
@wwwbruno
wwwbruno / Gemfile
Created July 24, 2014 15:03
Rails server config for ngnix server
# Use this gem in your Gemfile
gem 'unicorn'
@wwwbruno
wwwbruno / terminal.sh
Created August 7, 2014 13:59
Comando do terminal para o dia a dia
# zip folder
zip -r filename.zip foldername/
# unzip folder
unzip filename.zip -d folderdestination/
# copy file from local to remote
scp filename.zip user@server:/path/to/filename.zip
# copy file from remote to local
@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
@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