apidock.com

This is somewhat similar to the touch command of Linux: FileUtils.touch 'example.txt', :mtime => Time.now - 2.hours If you omit the :mtime...

This is for those who already own an SSL certificate (e.g. using it in the Apache HTTP Server) and need...

makandra dev

There are ongoing arguments on how useful this still is, as modern browsers become more comfortable to load images in parallel. However, many major websites still use them, for...

} } // opens a confirmation dialog if unsaved changes are present function bindAlertMethod() { $(window).on('beforeunload', function() { if (isUnsavedChangePresent() && !unloadTriggeredBySubmit) { return warningMessage; } }); } function isUnsavedChangePresent() { var unsavedChanges = false; // objects providing an isDirty...

...Using a css class as marker may make developers awere of the // special form behavior when inspecting the form classes function skipFormsWithOverwrittenSubmit() { _.each($('form input[type=submit]'), function(submitInput) {

...take many times longer to render. So measure before blaming the database. FULLTEXT performs better when your text has low redundancy FULLTEXT performance differs by a factor of 78 between...

...clone or #dup and you modify the copy, you will run into the following behavior: original_hash = { foo: { bar: 'original value' } } copied_hash = original_hash.dup copied_hash[:foo][:bar] = 'changed value...

makandra dev
medium.com

...this file as your project grows. The problem here is that this file potentially becomes very complicated to manage over the time. That’s why it’s important to find...

When your cucumber features grow massively over time, the test execution can take a lot of time.

codepen.io

...One might argue that could also omit position: relative on .section, and place the before/after helpers using left: 0 or right: 0. However, you'd then need to know the...

...disappear again when moving the mouse pointer to the left or right. Hovering the before/after elements actually means hovering the element itself...

Don't you just hate to write Cucumber path helpers to be able to say this?

When your Rails controller action responds with only a simple text, render text: 'Hello' may not be what you want...

The non-breaking space is prepended to the second element because that one becomes floating. Since that would discard any whitespace between the two elements, we are adding the...

In Ruby on Rails, all objects have a useful blank? method. It returns true for nil but also for empty...

TL;DR Debugging problems with javascript errors in cucumber tests is sometimes easier in the browser. Run the test, stop...

makandra dev

When you have a hook in your Capistrano file that dumps your remote database, you might not want it to...

Simple: Tell the application controller how to handle exceptions, here a RecordNotFound error. Do this with the following line: # application_controller.rb...

When you need to store structured data (like Ruby hashes) in a single database column with ActiveRecord, a simple way...

Note that this seems to affect only recent Rails 2 versions. You will not encounter this until you are writing...

jqueryui.com

UI sortable helps reordering items with drag 'n drop. It works quite fine. Proven configuration for sorting table rows

To upload a file via AJAX (e.g. from an ) you need to wrap your params in a FormData object.

...no guarantee the form submission has completed in Selenium before Ruby updates the record behind the scenes. In this case you might lose the update because the sign in process...

The Ace editor is a great enhancement when you want users to supply some kind of code (HTML, JavaScript, Ruby...

This is called "cherry-picking". git cherry-pick commit-sha1 Note that since branches are nothing but commit pointers, cherry...

matically. Automatic loading is disabled when this option is specified, and all loading becomes explicit. Files under directories named "support" are always loaded first. [...] $ cucumber -r features