Skip to content

Instantly share code, notes, and snippets.

View mmontalvo's full-sized avatar
🤖

Miguel Montalvo mmontalvo

🤖
View GitHub Profile
file_names = Dir["db/migrate/*"]
file_names.each do |file_name|
lines = File.readlines(file_name)
lines[0] = lines[0].gsub('ActiveRecord::Migration', 'ActiveRecord::Migration[5.2]')
File.open(file_name, 'w') { |f| f.write(lines.join) }
end
@mmontalvo
mmontalvo / gist:3303494
Created August 9, 2012 11:42
Postgres initial conf
$ sudo su postgres -c psql template1
template1=# ALTER USER postgres with PASSWORD 'password';
template1=# \q
@mmontalvo
mmontalvo / Mega-grep
Created November 25, 2010 22:48
To search a text inside files
find . -type f -exec grep -i "text_to_find" {} \; -print
@mmontalvo
mmontalvo / Utilities
Last active September 24, 2015 04:57
List of useful commands
# To uninstall ALL gems
for i in `gem list --no-versions`; do gem uninstall -aIx $i; done