This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
# | |
# Brute-force way to retrieve all Github's repositories at once | |
# Usage: | |
# github_repos.rb clone # will clone all the user's repositories | |
# github_repos.rb clone test # will just clone 6 repositories for testing purposes | |
# github_repos.rb pull # will update all of the user's local repositories | |
# | |
# If you have forked repositories, the original sources will be added | |
# as remotes with the default 'forked_from' name, and a new 'forked_from' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"estados": [ | |
{ | |
"sigla": "AC", | |
"nome": "Acre", | |
"cidades": [ | |
"Acrelândia", | |
"Assis Brasil", | |
"Brasiléia", | |
"Bujari", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class PopulaEstadosCidades < ActiveRecord::Migration | |
def self.up | |
Estado.create(:sigla => 'AC', :nome => "Acre") do |e| | |
e.cidades.build(:nome => "Acrelândia") | |
e.cidades.build(:nome => "Assis Brasil") | |
e.cidades.build(:nome => "Brasiléia") | |
e.cidades.build(:nome => "Bujari") | |
e.cidades.build(:nome => "Capixaba") | |
e.cidades.build(:nome => "Cruzeiro do Sul") | |
e.cidades.build(:nome => "Epitaciolândia") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Copyright 2013, Cassiano Rabelo (http://www.cassianorabelo.com) | |
* | |
* Licensed under The MIT License | |
* Redistributions of files must retain the above copyright notice. | |
* | |
* @Copyright Copyright 2013, Cassiano Rabelo (http://www.cassianorabelo.com) | |
* @license MIT License (http://www.opensource.org/licenses/mit-license.php) | |
* Date: 01/03/2013 | |
* Fonte: http://www.ibge.gov.br/cidadesat |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Os dados contidos nesse arquivo foram extraídos do site: http://ibge.gov.br/cidadesat utilizando ruby, nokogiri e expressões regulares. | |
-- Autor: Mauricio Natanael Ferreira | |
-- Github: https://github.com/manfe | |
-- Twitter: @manfe01 | |
-- Email: contato [at] ferreiramauricio [dot] com | |
-- *********************************************************************************************************************************************** | |
-- id ... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo -u postgres psql postgres | |
postgres=# ALTER USER postgres WITH PASSWORD '<newpassword>'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
du -h -a / | grep "[0-9]G\b" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo netstat -lnp |grep :25 | |
lsof -Pni | grep LIST | grep ":25" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ActiveRecord::Base.connection.reset_pk_sequence!('entities') | |
ActiveRecord::Base.connection.tables.map do |model| | |
ActiveRecord::Base.connection.reset_pk_sequence!(model.downcase) | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo chown -R `whoami` ~/.npm | |
sudo chown -R $USER /usr/local |
OlderNewer