If you are trying to inspect timings in JavaScript, you can use console.time and console.timeEnd which will write to your...

medium.com

Article about implementing authentication (current_user) and authorization (access rights) in AngularJS. Has an surprising amount of practical and understandable...

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

I had to deal with JavaScript Undefined Error while accessing a specific CKEditor instance to fill in text. Ensure everything...

Ask before leaving an unsaved CKEditor Vanilla JavaScript way, but removes any other onbeforeunload handlers: $(function(){ document.body.onbeforeunload = function() { for(editorName...

When you are working with Backbone models and inheritance, at some point you want to overwrite inherited methods but call...

makandra dev
mark-rolich.github.io

RulersGuides.js is a Javascript library which enables Photoshop-like rulers and guides interface on a web page Also available as...

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 = "_";