makandra dev
github.com

We proudly release our safe_cookies middleware into public beta and just published it on Github. Features are:

So you client has asked you to implement a row of buttons to like the URL on Facebook, Twitter and...

You might not know that Rails disables CSRF protection in tests. This means that if you accidentally forget to send...

Copy the attached file to features/support. This gets you a convenience method: Capybara.javascript_test? Is true for Selenium, capybara-webkit...

Working with lists in Javascript is painful because the native Array class is so poorly designed. One way to reduce...

angular-tips.com

Angular comes with different types of services. Each one with its own use cases. All of these services are singletons...

github.com

The asset pipeline (which is actually backed by sprockets) has a nice feature where templates ending in .jst are compiled...

For websites that don't do JavaScript rendering on the client, it's best practice to put script tags at...

Use the click method on the DOM element: let link = document.querySelector('a') link.click()

makandra Operations

Create a 1 GB file to swap to (we have sufficient space on / on this machine. Use a different partition...

Set the hash to a dummy hash which doesn't hit any id at your page, for example: window.location.hash = "_";

This card shows how to upgrade a Rails 2 application from Rails 2.3.8 through every single patch level up to...

Coffeescript allows you to create classes whose methods are automatically bound to the correct this. You can do this by...

Our development process makes us deploy very often. As the number of releases grows, junk clogs up the hard drive...

Getting a regular expression from a string in JavaScript is quite simple: new RegExp('Hello Universe'); # => /Hello Universe/

Authentication is hard: there are many edge cases, and most users (including yourself) usually only go the "happy path" once...

Note: This technique is confusing and slows down your test suite. Copy the attached code to features/support. This gets you...

stackoverflow.com

TL;DR: Variables not declared using var are stored outside the current scope, most likely in the global scope (which...

When a controller action redirects to an external URL (like http://somehost.com/some/path) you will find that this is hard...

opensoul.org

Great presentation about writing Javascript like you write everything else: Well-structured and tested. JavaScript is no longer a toy...

chartjs.org

Chart.js seems to be a good alternative to Google's Chart API and other commercial chart drawing libraries.

Don't Google this, you will lose all will to live. Instead use Object#isEqual() from Lodash or Underscore.js:

If you open a pop-up window [1] in your Selenium tests and you want to close it, you can...

makandra dev

JavaScripts and CSS should be minified for production use. In Rails 3.1+ the asset pipeline will take care of this...