How to initialize an Array of Hashes in Ruby

How to initialize an array of hashes. Each value of keys within the hash will initially consist of an empty array: your_hash = {|h,k| h[k] = [] }

Free Image Placeholder Service

Once you know the dimensions of the images (photos or graphics) you’re waiting your graphic designer or other developers to produce for you, instead of waiting for them to hand the final revisions of those images to you, you can use this free service Just put something like this in your HTML.

How to view rendered HTML of React component inside JavaScript console

Assume you have defined a React component that has a render function and assign it to variable someReactComponent. Then you can view the rendered version of the React component inside the JavaScript console by doing the following:

Does Rails Scale?

Does Rails Scale?

Is it Rails?

Wondering whether or not a website is running on rails? Check out Is it Rails? and let us know if the result was accurate for your site.

Most Popular In-Demand Programming Languages of 2014

Do you wonder which programming languages are the most popular and in-demand and how they compare with Ruby? Here is a comparison of the following languages: Ruby, Python, Php, Javascript, Scala, Java, Objective-C and C Unfortunately, I had to leave out Go in this comparison since “go” is such a generic term and “golang” didn’t […]

Using ActionMailer::Preview with Devise mailers in Rails 4.1

ActionMailer::Preview is pretty awesome and newly introduced in Rails 4.1+ It allows you to preview formatting of emails from within the browser without having to send emails just to be able to preview them in the email client. This substantially reduces the duration of each development cycle between coding and testing a modification. If you […]

rails server fails to start – bin/rails:6: warning: previous definition of APP_PATH was here

If rails server fails to start for you due to APP_PATH issue below: I was able to fix the above issue in two ways: You can either comment out the spring gem or do the following instead, which I recommend: From within your project directory, do the following: Do the following at your own risk!!! […]

Incorrect MySQL client library version! This gem was compiled for 5.6.21 but the client library is 10.0.14-MariaDB

If you get the following error, you probably have to reinstall your mysql2 gem by specifying the location of your MariaDB or MySQL installation. The Error: Uninstall existing mysql2 gem: Install mysql2 gem again: If you still see issues: Here is the error you might see: Uninstall existing mysql2 gem: Install mysql2 gem again: The […]

.rvm/scripts/functions/support: line 490: 10144 Trace/BPT trap: 5 issue

When I was trying to install ruby-2.1.3 via RVM (rvm install 2.1.3), I got the following error: I resolved this issue by reinstalling ruby 2.1.3 with –disable-binary option: