When making cross-domain AJAX requests with jQuery (using CORS or xdomain or similar), you will run into issues with...

Code snippet tested with Rails 2.3 def index # ... if request.xhr? html = render_to_string(:partial => "list", :layout => false) respond_to...

If your requests blow up in Ruby or CURL, the server you're connecting to might only support requests with...

This card describes how to pass an array with multiple element to a JavaScript function, so that the first array...

In whenever you can schedule Ruby code directly like so: every 1.day, :at => '4:30 am' do runner "MyModel.task_to...

If you have some file or directory that should trigger a Spring reboot, tell Spring e.g. in config/spring.rb: Spring.watch 'file.rb...

When you tell rbenv to install a Ruby it does not know about, you will get an error message.

makandra dev
menuetos.net

MenuetOS is an Operating System in development for the PC written entirely in 32/64 bit assembly language. Menuet64 is released...

So you have a restangular collection and you want to remove an element from it, after you've successfully deleted...

With this command you can initiate an application restart without touching restart.txt. Unlike touching restart.txt, this tool initiates the restart...

If you regularly get ActionView::MissingTemplate exceptions, maybe some bot visits your site requesting silly formats like: http://www.rails-app.com/makandra.html-username-2000...

github.com

better_errors is an awesome gem for enhanced error pages in development, featuring a live-REPL for some light debugging...

Your development machine is usually on a very good network connection. To test how your application behaves on a slow...

requiremind.com

Batman is an alternative Javascript MVC with a similar flavor as AngularJS, but a lot less features and geared towards...

Development environment setup Rails Composer : Basically a comprehensive Rails Template. Prepares your development environment and lets you select web server...

Browsers usually cache favicons. If you update the favicon of your web site and want all visitors to see the...

When you do something like this in your code: def var_value @var ||= some_expensive_calculation end

TLDR: This card explains which threads and processes interact with each other when you run a Selenium test with Capybara...

In Ruby, classes and modules are called constants. This card explains how Ruby resolves the meaning of a constant.

CarrierWave attachments have two distinct methods #url and #path which appear to behave the same: document.file.url # => /storage/documents/4/letter.doc document.file.path # => /storage/documents/4/letter.doc

makandra dev
github.com

Rack::Attack is a rack middleware to protect your web app from bad clients. It allows whitelisting, blacklisting, throttling, and...

Use protocol independent URLs whenever possible so that the browser will choose the protocol related to the protocol which the...

When I upgraded from 0.5.4 PDFKit deadlocked or crashed when an ApplicationController::RouteError occured. If this error happens only because...

Ubuntu 12.04 LTS x64, Ruby 1.8.7, Rails 2.13, PDFKit 0.5.4, Phusion Passenger Apache 2 I ran into this, when I...