Get rid of dead keys under XFCE
Under XFCE keys like tilde are dead by default, which is impractical for programming and terminal work. To get rid of dead keys, open your Settings Manager and go to Keyboard. Under the Layout tab you can keyboard layouts like "German (eliminate dead keys)".
There is still a way to type accented characters.
Make Makandra Consul work with RSpec 2.x and Rails 3.x
To make the RSpec matcher of the authorization solution Consul work with Rspec 2.x read the following blog post.
Firefox 3.6 Support To end On April 24, 2012
Firefox 3.6 users will receive update notifications in April offered through the browser’s internal updating service that will update the version to the latest stable build of the browser.
Fix: Cucumber won't start though cucumber.yml is correct
This is for you if you get this error:
cucumber.yml was found, but could not be parsed. Please refer to cucumber's documentation on correct profile usage.
Actually, it's likely that your cucumber.yml
is just fine but not your rerun.txt
.\
This sometimes happens when running multiple Cucumber workers with parallel_tests
that write into rerun.txt
simultaneously -- ending up with a messy, invalid file.
Just remove it and you ar...
CSS box-shadow not working in IE9 inside tables with collapsing borders
Though Internet Explorer 9 supports the box-shadow
CSS property there is a nasty bug which sometimes prevents it from rendering the shadow properly.
Consider this HTML:
<table style="border-collapse: collapse">
<tr>
<td>
<div style="box-shadow: 0 0 10px #f00">Hello universe</div>
</td>
</tr>
</table>
While it works in other browsers, IE9 is not showing any shadow. For some reason, it requires border-collapse: separate
for the table to be set:
<table style="border-collapse: separate" c...
Pull Quotes with HTML5 and CSS
A pull quote is a typographical technique in which an excerpt or quote from an article is duplicated within the article using a different formatting style so that it jumps out at the reader.
Blatantly copying the excerpt of the pull quote into it’s own element is not the way to go. A pull quote is a purely visual technique, and therefore should not change the structure of the body. Next to that, a structural representation of the excerpt would be seen twice by people using feed readers or services like Instapaper, as well as be re-read for ...
How to embed images in higher resolutions for printing
When you print out a HTML pages, all raster images (like PNGs) will appear aliased. This is because a printer's resolution is usually much higher than that of a computer screen.
If an image absolutely must look awesome when printed, a solution is to embed the image in much higher solution than needed (e.g. four times the horizontal resolution), then scale it down to the desired width using CSS.
Note that this will slightly alter the image's appearance on the screen because browsers will scale down the image [using an anti-aliasing method](...
monperrus/ExpandAnimations - GitHub
ExpandAnimations is a LibreOffice/OpenOffice.org Impress extension to expand presentation animations before exporting to PDF. This way the exported PDF will have one page per animation stage.
German localization for Mobiscroll
If you are using Mobiscroll for date pickers on touch devices, here is how to localize the Mobiscroll UI into German:
var germanMobiscrollLocalization = {
preset: 'datetime',
ampm: false,
cancelText: 'Abbrechen',
dateFormat: 'dd.mm.yy',
dateOrder: 'ddmmyy',
dayNames: ['Sonntag', 'Montag', 'Dienstag', 'Mittwoch', 'Donnerstag', 'Freitag', 'Samstag'],
dayNamesShort: ['So', 'Mo', 'Di', 'Mi', 'Do', 'Fr', 'Sa'],
...
Date or datetime picker for touch devices
jQuery UI's date picker and date time picker doesn't work on touch interfaces.
Solution 1: Use Mobiscroll
Another way is to detect touch devices and for those devices use the Date and DateTime picker from Mobiscroll instead:
if (isTouchDevice()) {
$('.date_picker').scroller();
} else...
Detect mobile or touch devices on both server and client
Although it's tempting flirt with detecting mobile/touch devices with CSS media queries or Javascript feature detection alone, this approach will be painful when heavily customizing a feature beyond just tweaking the looks. Eventually you will want want the same detection logic to be available on both server and client side.
This card shows how to get a Ruby method touch_device?
for your Rails views and a method TouchDevice.isPresent()
for your Javascripts.
Note that we are detecting touch devices by grepping the user agent, and the ke...
acts_as_taggable_on: Match records tagged with all, any or none of the given tags
The tagged_with
scope comes with many awesome options to modify your search:
User.tagged_with("awesome", "cool") # Users that are tagged with awesome and cool
User.tagged_with("awesome", "cool", :exclude => true) # Users that are not tagged with awesome or cool
User.tagged_with("awesome", "cool", :any => true) # Users that are tagged with awesome or cool
User.t...
Always sort lists that are visible in the UI
This might seem obvious, but I'm rejecting stories because of this on a regular basis.
Whenever a list (e.g. an index of records or the options of a select box) is visible in the UI that list must be sorted. Unsorted lists are completely unusable once they contain more than 5 items.
How to click hidden submit buttons with Selenium
In your Cucumber features you can't really click hidden elements when using Selenium (it does work for a plain Webrat scenario, though).
Unfortunately you need to hack around it, like this:
When /^I press the hidden "([^\"]+)" submit button$/ do |label|
page.evaluate_script <<-JS
$('input[type=submit][value="#{label}"]').show().click();
JS
end
If your button is nested into a container that is hidden this will not do the trick. You need a more complex method to also show surrounding containers:
When /^I pre...
Locale: Localisation for Rails developers
A possible way for localisation in Rails applications that allows editing translations remotely.
How to fix the Apple Mail search problem in MacOS X 10.7 Lion
After my update from MacOS X 10.6 Snow Leopard to 10.7 Lion the search function in Apple Mail stopped working.
There were no or too little search results, when I typed something in the search field.
It looked like my mailboxes couldn't be indexed by spotlight anymore.
And here is the simple solution:
- Mark your mailbox in the list of mailboxes on the left in your apple mail window by clicking on its name once.
- From the menu select "Mailbox" => "Rebuild".
- After the rebuild you should get the right search results again.
- Proceed wi...
Right-align or center panel items in XFCE
- Add a separator between left-aligned and right-aligned items.
- In the separator properties, set the style to "Transparent" and check "Expand".
- The separator will now grab all available space and hence push the right-hand items into the corner.
You can also use this trick to center panel items by using two separators (one on the left, one on the right side).
Get color in the Capistrano output
Note: capistrano_colors
was merged into Capistrano starting from v2.13.5. However, this requires Ruby 1.9+.
If you cannot upgrade Capistrano to 2.13.5+ (e.g. because you're still running on Ruby 1.8), simply put capistrano_colors
into your Gemfile and require 'capistrano_colors'
in your config/deploy.rb
file.
Skype For Linux With Tabs Support Using SkypeTab NG
SkypeTab-NG (NG stands for Next Generation) is a tool that adds tabs to Skype for Linux. Besides providing a tabbed chat window, the SkypeTab-NG also embeds both the conversation and the main Skype windows in a single window.
tanoku/redcarpet - GitHub
Ruby bindings for Sundown, a fast and full-featured Markdown parser that lets you define renders for arbitrary output formats.
Limiting CPU and memory resources of Paperclip convert jobs
If you're using Paperclip to store and convert images attached to your models, processing a lot of images will probably cause headache for your system operation colleagues because CPU and/or memory peaking.
If you're on Unix you can use nice
to tell the Kernel scheduler to prefer other processes that request CPU cycles. Keep in mind that this will not help if you're running into memory or IO trouble because you saved some bucks when you ordered (slow) harddrives.
ImageMagick (the tool which is used by Paperclip to do all that funky ima...
Error "The --deployment flag requires a Gemfile.lock. Please make sure you have checked your Gemfile.lock into version control before deploying."
If you get this error while deploy and you are sure the Gemfile.lock is in the version control check your releases directory.
This error can occur if someone/something copy a file or directory into your releases directory.
Update: Aggregated RSpec/Cucumber test coverage with RCov
Our rcov:all
task for aggregated RSpec/Cucumber coverage was overhauled extensively. Among other things it now works for Rails 2 and 3 and has an option to ignore shared traits.
RCov: The difference between "code coverage" and "total coverage"
Code coverage is the ratio of code lines kissed by a test vs. the total number of lines in your source files. This sounds meaningful, but isn't.
Total coverage additionally ignores whitespace and comments when computing the coverage ratio, which is what you want.