This file contains hidden or 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
# require email receipt | |
headers['Return-Receipt-To'] = '[email protected]' |
This file contains hidden or 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
# importance flag on the email | |
headers['Importance'] = 'high' | |
headers['X-Priority'] = '1' | |
headers['X-MSMail-Priority'] = 'High' |
This file contains hidden or 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
all_routes = Rails.application.routes.routes | |
all_routes.each do |route| | |
if route.requirements.has_key?(:controller) and route.requirements[:controller] != "rails/info" then | |
puts "#{route.requirements[:controller]} #{route.requirements[:action]}" | |
end | |
end |
This file contains hidden or 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
### matches all git tags that start with numeric value, update regex as needed | |
# commands to remove local tags | |
git tag -l | grep "^\d" | sed 's/^/tag -d /' > _remove_tags | |
# commands to remove remote tags | |
git tag -l | grep "^\d" | sed 's/^/push origin :refs\/tags\//' > _remove_tags_remote | |
# review contents of file | |
cat _remove_tags | while read line; do echo $line; done | |
# execute each line in file |
This file contains hidden or 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
<!-- | |
1) include in layout files after all other javascript includes | |
2) if you have coffeescript classes that match your controller name - they will be invoked automatically | |
WARNING: as a general rule don't write js like this with ruby mixed in, | |
this is one of those rare cases where it 'works' well | |
--> | |
<script> | |
$(document).ready(function () { |
This file contains hidden or 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
-- changes [email protected] -> [email protected] | |
update users set email = replace(replace(regexp_matches(email, '.*@')::varchar, '{', ''), '}', '') || 'qa.com'; | |
-- there must be a better way to get rid of the {} chars returned by regexp_matches |
This file contains hidden or 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
select md5(random()::text) | |
This file contains hidden or 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
psql your_db -c "update users set is_active = 'f';" |
This file contains hidden or 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
psql postgres -c "select pg_terminate_backend(procpid) from pg_stat_activity where datname='your_db';" | |
dropdb your_db | |
createdb --template=template0 --encoding=unicode your_db | |
This file contains hidden or 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
# replace your_db with the name of your database | |
psql postgres -c "select pg_terminate_backend(procpid) from pg_stat_activity where datname='your_db';" |