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
Mail::ReceivedField.class_eval do | |
def formatted_date | |
date_time.strftime("%a, %d %b %Y %H:%M:%S ") + date_time.zone.delete(':') | |
rescue ArgumentError => e | |
raise e unless "invalid date"==e.message | |
end | |
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
1) backup production database: | |
heroku pgbackups:capture --expire --remote production | |
2) obtain url string to backup from step 1: | |
heroku pgbackups:url --app production_app_name --remote production_app_branch_name | |
3) transfer backup from production to staging app: | |
heroku pgbackups:restore DATABASE 'production_app_backup_url_string_from_step_2' --app production_app_name --app staging_app_branch_name |
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
# If your workers are inactive for a long period of time, they'll lose | |
# their MySQL connection. | |
# | |
# This hack ensures we re-connect whenever a connection is | |
# lost. Because, really. why not? | |
# | |
# Stick this in RAILS_ROOT/config/initializers/connection_fix.rb (or somewhere similar) | |
# | |
# From: | |
# http://coderrr.wordpress.com/2009/01/08/activerecord-threading-issues-and-resolutions/ |
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
1. Download printer driver from: | |
http://www.usa.canon.com/cusa/support/consumer/printers_multifunction/imageclass_series/imageclass_mf4350d#DriversAndSoftware | |
sudo apt-get install libc6-i386 ia32-libs lib32z1 alien | |
sudo -i | |
cp /home/user/Downloads/Linux_UFRII_PrinterDriver_V250_us_EN.tar.gz /opt/ | |
cd /opt | |
tar xzvf Linux_UFRII_PrinterDriver_V250_us_EN.tar.gz | |
cd Linux_UFRII_PrinterDriver_V250_us_EN/64-bit_Driver/RPM | |
ln -s /usr/lib /usr/lib64 |
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
Uncaught exception: SyntaxError: Function constructor: failed to compile function | |
Error thrown at line 22, column 8 in <anonymous function>(str, data) in http://dev.wilsonsdev.com/assets/jquery-fileupload/vendor/tmpl.js?body=1: | |
var f = !/[^\w\-\.:]/.test(str) ? tmpl.cache[str] = tmpl.cache[str] || | |
called from line 22, column 8 in <anonymous function>(str, data) in http://dev.wilsonsdev.com/assets/jquery-fileupload/vendor/tmpl.js?body=1: | |
var f = !/[^\w\-\.:]/.test(str) ? tmpl.cache[str] = tmpl.cache[str] || | |
called from line 11, column 10 in <anonymous function: add>(e, data) in http://dev.wilsonsdev.com/assets/users/images.js?body=1: | |
data.context = $(tmpl("template-upload", file)); | |
called via Function.prototype.call() from line 277, column 2 in <anonymous function: _trigger>(type, event, data) in http://dev.wilsonsdev.com/assets/jquery-fileupload/vendor/jquery.ui.widget.js?body=1: | |
return !( $.isFunction(callback) && | |
called from line 756, column 16 in <anonymous function: _onAdd>(index, element) |
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
VBoxManage internalcommands sethduuid XXX.VHD (if not in the current path use full path to .vdh file) |
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
# Gemfile | |
gem "puma" | |
# Procfile | |
web: bundle exec puma -p $PORT -e $RACK_ENV -C config/puma.rb | |
# add to config block config/environments/production.rb | |
config.threadsafe! | |
# get rid of NewRelic after_fork code, if you were doing this: |
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
RUBY_CONFIGURE_OPTS="--with-openssl-dir=$(brew --prefix openssl) --with-readline-dir=$(brew --prefix readline)" rbenv install 2.4.4 |
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
launch a terminal and issue this command: | |
defaults write com.apple.finder _FXShowPosixPathInTitle -bool true; killall Finder |