Skip to content

Instantly share code, notes, and snippets.

View dakoctba's full-sized avatar
🇧🇷
"Simplicity is the ultimate sophistication" - Leonardo da Vinci

Jackson Teixeira dakoctba

🇧🇷
"Simplicity is the ultimate sophistication" - Leonardo da Vinci
View GitHub Profile
@dakoctba
dakoctba / gist:7676845
Last active November 2, 2024 18:59
How To Reset Your Github Fork

##How To Reset Your Github Fork

Let’s say I want to contribute to a project on github. The project repository is at wp-cli/wp-cli. First I fork it, and then clone the resulting repository, scribu/wp-cli:

git clone --recursive [email protected]:scribu/wp-cli.git
cd wp-cli

Now, I make some commits to master, push them to my fork and open a pull request. Piece of cake:

git commit -m "awesome new feature"

@dakoctba
dakoctba / gist:7691556
Last active December 29, 2015 15:38
Como excluir branch remoto

##Como excluir branch remoto

git push origin --delete or git push origin :

@dakoctba
dakoctba / gist:7696691
Created November 28, 2013 18:57
Como gerar secret token (rails 4)

##Como gerar secret token (rails 4)

cd app
rake secret

Copiar a chave criada para o arquivo app\config\secret_token.rb com a seguinte sintaxe:

::Application.config.secret_key_base = ''

@dakoctba
dakoctba / gist:7805732
Created December 5, 2013 14:12
How to install Bower (needs Node.js with npm)

##How to install Grunt

sudo npm uninstall -g grunt
sudo npm install -g grunt-cli

Prepare package.json file

npm init

Add grunt server dependency

@dakoctba
dakoctba / gist:7830106
Last active December 30, 2015 12:39
How to init a grunt project in Vagrant environment (Node.js)

##How to init a grunt project in Vagrant environment (Node.js)

// Open a directory
cd project-folder

// Install the dependencies (note the --no-bin-links parameter)
sudo npm install --no-bin-links

// Run Grunt

grunt

@dakoctba
dakoctba / gist:8604333
Created January 24, 2014 19:30
O que fazer quando o vagrant perde a referência da VM

##O que fazer quando o vagrant perde a referência da VM

Normalmente, quando o Vagrant perde a referência a uma máquina virtual, ele cria uma segunda máquina e começa a utilizar esta.

A solução fica fácil: simplesmente remova o disco virtual da nova máquina e configure para apontar para o disco da máquina anterior.

##Erros comuns no Vagrant

###O que fazer quando Vagrant dá algum erro de plugin

  • (dos) vagrant plugin list
  • (dos) vagrant plugin update
  • (dos) vagrant plugin list -- só para certificar

###O que fazer quando Vagrant não monta a pasta compartilhada

  • (linux) sudo ln -s /opt/VBoxGuestAdditions-4.3.10/lib/VBoxGuestAdditions /usr/lib/VBoxGuestAdditions
  • (dos) vagrant reload
@dakoctba
dakoctba / gist:10848137
Created April 16, 2014 10:21
How do I delete the unused COM ports in Windows 7?
The trick was to open the Command Prompt as administrator and start the Device Manager from the same command prompt.
1. Right-click “Command Prompt” in Accessories and choose “Run as Administrator”
2. Enter “set devmgr_show_nonpresent_devices=1″ – without the quotes obviously
3. Enter “start devmgmt.msc”
4. In the box that opens, select “Show hidden devices” in the ‘view’ menu.
Now if you expand the section on COM ports, all the COM ports that have ever
been created will be displayed, the non present ones being in grey. You can
uninstall away anything that you don’t want (right click, select uninstall).
@dakoctba
dakoctba / gist:246c38baa5d14e064e7e
Created June 26, 2014 14:45
Desinstalar Postgres por completo
sudo apt-get --purge remove postgresql postgresql-client postgresql-client-common
sudo apt-get autoremove
caso ainda fique alguma pasta: sudo rm -rfv opt/Postgres