When you accept a table in your Cucumber step definition, that table object will have the cryptic type
Cucumber::Ast::Table. Don't immediately call
table.raw to convert it into an array of arrays!
Cucumber::Ast::Table has a lot of useful methods for tasks such as:
If git gives you an error message such as "fatal: bad config file line 123 in .git/config" after you tried to checkout a branch with a very long branch name, you very likely come across a bug in git version < 1.8.
You should ask someone with a newer git version (someone pushed the branch right?) to rename the branch to something shorter:
git -m old-very-very-long-branch-name new-short-branch-name
When deploying Rails applications you might have noticed that JS and CSS are not cached by all browsers.
In order to force Apache to add expiry dates to its response, add the attached
.htaccess to the public directory. This will add a header such as
Expires: Thu, 07 Oct 2010 07:21:45 GMT to the httpd response.
Check that you have
mod_expires enabled. You need it for the attached
.htaccess to work:
sudo a2enmod expires
You can add this:
Consul 0.6.1+ gives you a way to dynamically access and query powers for a given name, model class or record.
A common use case for this are generic helper methods, e.g. a method to display an "edit" link for any given record
if the user is authorized to change that record:
module CrudHelper def edit_record_action(record) if current_power.include_record?(:updatable, record) link_to 'Edit', [:edit, record] end end end
You can find a full list of available …
Prism is a new lightweight, extensible syntax highlighter, built with modern web standards in mind. It’s a spin-off from Dabblet and is tested there daily by thousands.
About Chrome's network stack and optimizations to load web pages faster.
January has been a very bad month for Ruby on Rails developers, with two high-severity security bugs permitting remote code execution found in the framework and a separate-but-related compromise on rubygems.org, a community resource which virtually all Ruby on Rails developers sit downstream of. Many startups use Ruby on Rails. Other startups don’t but, like the Rails community, may one day find themselves asking What Do We Do When Apocalyptically Bad Things Happen On Our Framework of Choice? I thought I’d explain that for the general c…
Do not investigate in the 2342 tools that exist for migrating IMAP accounts from one server to another. They all suck.
Try your luck with imapsync.
We have no clue why the guys suggest buying the script on their site, maybe they missed removing that part after this April fool's trick.
Go to https://fedorahosted.org/released/imapsync/ and get the sources there.
Amazon Elastic Transcoder is video transcoding in the cloud. It is designed to be a highly scalable, easy to use and a cost effective way for developers and businesses to convert (or “transcode”) video files from their source format into versions that will playback on devices like smartphones, tablets and PCs.
This might be a good alternative for services like Panda which charge a large monthly fee just to be available for your encoding requests. Amazon's service bills by usage instead:
A 10 minute sourc…
We recently had a problem on a Memcache cluster, where one of the servers showed a significantly worse cache hit rate and a lot more evictions.
It turned out that the only reason was that the server was running for a few months longer than the others. Some investigation showed this to be a known problem with Memcache: Once your cache gets full, it might be "hardwired" for your specific usage patterns. If those change (and you for example start to store larger values), memory is no longer allocated optimally, in extreme cases Memcache might …
The attached article outlines considerations when choosing client-side vs. server-side implementations of the Google Geocoding APIs (geocoder, directions, not maps drawing). The main points are:
Microsoft provides images with different IE and Windows combinations for different hosts.
There are also Virtual Box images for Linux hosts.
If you have an integer and want to use it to represent an element's position (like "1st" for 1, or "2nd" for 2), you can use ActiveSupport's
1.ordinalize # => "1st" 2.ordinalize # => "2nd" 1002.ordinalize # => "1002nd" 1003.ordinalize # => "1003rd" -11.ordinalize # => "-11th" -1001.ordinalize # => "-1001st"
Spreewald now comes with a step that tests if a form field is visible:
Then the "Due date" field should be visible But the "Author" field should not be visible
It is not currently tested if the label is visible or hidden. For this see: [Check that an element is visible or hidden via CSS with Cucumber/Capybara](https://makandracards.com/makandra/1049-check-that-an-elem…
Consul 0.6.1+ gives your
Power class a number of static methods that behave neutrally in case
nil. This allows you to create authorization-aware models that still work when there is no user at the end of a web browser, e.g. on the console, during tests or during batch processes.
You will often want to access
Power.current from another model, to e.g. iterate through the list of accessible users:
class UserReport def data Power.current.users.c...
Behave.js is a lightweight library for adding IDE style behaviors to plain text areas, making it much more enjoyable to write code in. Features include:
<video>elements. Stupid reasons include saving mobile bandwidth on behalf of the user and/or securing app store sales.
I tested this on Chrome for Android. The int…