Running into this error when trying to watch Amazon on Demand on Ubuntu? An error occurred and your player could not be updated. This is likely because your Flash Player or Browser needs to be updated. This update is required to play back this video. You’re not alone. To get Amazon on Demand to work […]
Author: anthony
grep search and replace
To search and replace a string using grep at the linux CLI, you can do the following: grep -rl “string-to-match” directory/ | xargs sed -i ‘s/string1/string2/g’
Rails override default scope ordering
If you have an ordering default scope that you’d like to override with a different ordering, you can do the following: Change the order() method to .reorder() This will remove all pre-existing default scope orderings and replace them with the argument found within the reorder request.
Heroku Rails 4 assets missing
If you’ve recently loaded a new Rails 4 application to Heroku and your assets are missing (css, js, etc) – you’re not alone. Add the following lines to your production.rb (or staging.rb) environment configuration files: config.serve_static_assets = true config.assets.compile = true Then push the changes up to Heroku and you’re good to go.
Rails remote multipart form with remotipart bind ajax:success
Rails 3.x / 4.0 does not handle remote multipart forms natively, so a workaround is needed. To get remote multipart forms working correctly you can use the following steps (quick solution). First: Add the remotipart gem to your GemFile gem ‘remotipart’, ‘~> 1.2.1’ Then, Update your javascript manifest file (in basic configurations this is usually […]
Bootstrap Modal – load remote url multiple times
If you’re using Bootstrap 3.x to generate a remote link based modal, you’ll notice that re-clicking the same link does not re-request the content of the remote URL and instead just re-displays the same content from the previous load. This isn’t a great result in many cases (forms for new objects for instance). To resolve […]
VirtualBox resizing vmdk to increase dev/mapper partition
If you’ve run out of space on a VirtualBox vmdk drive and want to increase the partition’s size, do the following: 1) Download the GParted ISO from their website. 2) Convert your vmdk to a vdi (VBoxManage can be found in your virtualbox “program files” directory. Use explicit file paths if needed) >> VBoxManage clonehd […]
JQuery Sortable with multiple sections within the same view
I ran into an issue the other day where multiple sortable regions were dynamically created within the same view, all with the same class structure. After running > $(“.the-class”).sortable({…}) I noticed that only the first sortable region was actually sorting. To resolve this issue iterate over the class and call sortable on each individual element. […]
Rails 4 TurboLinks with JQuery document ready
Using JQuery’s $(document).ready() functionality seems to be broken when using’s the Rails Gem Turbolinks. However, to fix any issues you are experiencing, add the jquery-turbolinks gem to your Gemfile > gem ‘jquery-turbolinks’ Then, add the following line to your JS manifest file, typically application.js in your assets directory: //= require jquery.turbolinks After which, restart your […]
Rails Capistrano deployment: SSH, Error reading response length from authentication socket
If you’re running a rails application with capistrano and you run into the following error: Error reading response length from authentication socket When you attempt to connect via cap, for instance > cap staging deploy Then make sure you can answer the following questions with a ‘yes’ before continuing. 1) Is my private key properly […]