css-tricks.com

Crazy hack. Might be useful one day. The code required has since been extracted into a library.

makandra dev
cssdeck.com

Clever hack to allow user interaction without Javascript (by using radio buttons and selecting on :checked).

You might sometimes use self to capture the context of this before it is destroyed by some function. Unfortunately self...

confreaks.com

Opal is a source to source ruby to javascript compiler, corelib and a runtime implementation that currently passes 3000 rubyspecs...

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

ng-newsletter.com

Search engines, such as Google and Bing are engineered to crawl static web pages, not javascript-heavy, client-side apps...

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()

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...

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...

blog.codeclimate.com

Rails’ reputation as a relatively secure Web framework is well deserved. Out-of-the-box, there is protection against many...