For two years we've been using
SearchableTrait which gives models the ability to process Googlesque queries like this:
Contact.search('a mix of words "and phrases" and qualified:fields')
This trait used to be a huge blob of code without tests and documentation, so I made a gem out of it. Check out https://github.com/makandra/dusen for code, tests, and a huge README.
You should use the Dusen gem and delete
SearchableTrait in all future projects.
Note that the syntax to define query proc…
Xfce gives you a million options to configure your panels. Together with Xfce's sometimes arcane configuration UI, this can be a huge time waster and super-annoying if you need to get work done the same day.
This card describes how to setup a classic panel layout as you might be used to from Gnome 2 or Windows (see screenshot below). You can use this to quickly get productive in Xfce, and as a starting point for further customization.
If you tried out Compiz on top of Xfce and found it to be a world of pain like me, you can get to Xfce's native window manager by saying:
If you don't want to mess around with arcane incantations inside
xorg.conf, you can use the graphical
sudo apt-get install arandr arandr
If all your monitors are stacked in the same space, the space is not wide enough and you can't really move them, you need to switch to a proprietary driver. If it works with the open source driver for you, do not bother using another one.
amdcccle; if the binary is unavail…
If you have a PNG and want to know a pixel's alpha channel value, you can use Gimp:
Shiftkey while clicking the pixel
A window will appear, containing color information, including the alpha channel.
Hopefully you are using Psych for everything, but if you have legacy Syck YAML files lying around you could be in for some pain because they are not necessarily compatible. In my case, I had a bunch of i18n translation files emitted with Syck which uses an incompatible escape code structure instead of plain utf-8, thereby rendering the files unreadable by both Psych and humans alike. My solution was a little script utilizing the fact that the engine can be swapped dynamically.
When you want to copy/move from a shared folder (on Windows guests, for example) and it fails with absurd error messages (lots of text or an error about the target being read-only), you are probably running on Guest Additions that no longer match your VirtualBox version.
Fix: install the latest VirtualBox Guest Additions in your guest machine.
Note that you need to make sure you are using the correct ISO.
Global keyboard shortcuts can be configured in two separate panels in the Xfce Settings manager:
If you can now longer hear or record sounds after upgrading Ubuntu, you probably need to re-tell Ubuntu which devices to use for playback/recording.
pavucontrol). If you don't have that application, install it with
sudo apt-get install pavucontrol.
This may be configured for you by default.
Unlike in Gnome, there is no graphical tool to set a mouse cursor in Xfce. Run this on a terminal instead:
sudo update-alternatives --config x-cursor-theme
You need to sign out and back in for your changes to have an effect.
Cards can now be flagged as "Repeating".
Every Wednesday, some of these cards will be moved back to the top of the deck.
This is intended for important cards that you want your team to occasionally repeat, so they aren't lost in the depths of your deck.
For your own deck, you can set the number of cards to repeat in your Deck Admin.
When you are trying to install/update VirtualBox Guest Additions on your guest machine but the setup is for a different/older version (for example 4.0.4 tools for a 4.1.x VirtualBox installation), try this:
sudo apt-get install virtualbox-guest-additions-iso
For some reason, this is no dependency to VirtualBox itself – and if you have an old ISO lying around, VirtualBox will just pick that one, regardless of its version.
When your file manager sorts file case-sensitively after a distribution upgrade, you probably need to reconfigure your locale settings as described here.
So you have multiple screens under Xfce and want to have one task bar on each screen, only showing applications on that screen. Here you go:
In Rails 2, when calling
instance_exec on a scope, the scope will fetch its records from the database.
This has been fixed in Rails 3+.
imgAreaSelect is a jQuery plugin for selecting a rectangular area of an image. It allows web developers to easily implement image cropping functionality, as well as other user interface features, such as photo notes (like those on Flickr).