When you cannot make Selenium trigger events you rely on (e.g. a "change" event when filling in a form field...

blog.salsify.com

An all-in-approach to fix the problem of pending AJAX requests dying in the browser when the server ends...

I use this to simulate the (non-existing) :last-letter CSS pseudoclass, e. g. to insert a tombstone at the...

code-experience.com

React.js is a relatively new Javascript templating engine that has two-way-bindings like AngularJS or Batman. The interesting idea...

makandra dev

When you want the table headers to always stay around (e.g. because that table is huuuge), use the code below...

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

If you are using Angular and want something like Rails' simple_format which HTML-formats a plain-text input into...

If you want to do JavaScript-style camelization, ActiveSupport's String#camelize method can actually help you out. Simply pass...

If you come across an (older) application that is using Prototype instead of jQuery, you may often see events bound...

blog.codeclimate.com

Splitting a long method into sub methods is easier in instances since it is in classes. Since...

requiremind.com

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

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

makandra dev

rake stats # => LOC per controllers, models, helpers; code ratios, and more rake notes # => collects TODO, FIXME and...

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

relishapp.com

Sometimes you have a test expectation but actually want a better error message in case of a failure. Here is...

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

If you get this error while trying to resize an openstack instance: # nova resize fooinstance 16 --poll ==> /var/log/nova/nova-scheduler.log <==

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