By beyondthewheel
I’m not a huge fan of Yahoo! IM, but I do have clients and co-workers that use it so I really need it to work in Pidgin. A recent protocol upgrade at Yahoo! broke Pidgin 2.5.5. I found several ‘fixes’ out there that included changing the named pager server to an IP address. But none of those worked for me.
In typical fashion I checked the official sources last but the Pidgin website has an updated version that has fixed the Yahoo! problem — http://www.pidgin.im/download/ubuntu/
In brief, we just need to get the latest version (2.5.7) from Pidgin rather than from Ubuntu sources.
Simply run these two commands in a terminal:
sudo apt-key adv --recv-keys --keyserver keyserver.ubuntu.com \
67265eb522bdd6b1c69e66ed7fb8bee0a1f196a8
echo deb http://ppa.launchpad.net/pidgin-developers/ppa/ubuntu \
`lsb_release --short --codename` main | \
sudo tee /etc/apt/sources.list.d/pidgin-ppa.list
And then update apt and upgrade pidgin:
sudo apt-get update
sudo apt-get install pidgin
By beyondthewheel
I love the new libnotify notifications in Ubuntu Jaunty Jackalope, but don’t really want my IM messages popping up on the top right of the screen — especially at work.
So how do you get Pidgin to just quietly blink in your system tray like it used to?
Pidgin uses libnotify as a plugin to make those notification happens, and you can turn it off like any other. Go to Tools->Plugins and find “Libnotify Popups” and uncheck it.
Then to get your old notifications back check the “Message Notification” plugin. Then go to Tools->Preferences and set “Show system tray icon” to Always on the Interface tab. Then you can right-click on your Pidgin icon in the system tray and check “Blink on New Message” so you at least know when someone is trying to chat with (distract) you.
By beyondthewheel
Recently I had a need for a data report with shopping cart-like behavior — let the user paginate through a list of items, drag items of interest to a “basket” and then take action on all items in the basket.
To do this, I used the “draggable” and “droppable” functionality in jQuery UI. jQuery makes drag and drop (and everything else) ridiculously easy.
The only trick here was managing the “basket” contents with CakePHP.
My data was laid out in a table, so I took the item name and wrapped it in a div with a ‘draggable’ class like this:
<div class="draggable"><?php echo $item['Ite']['name']; ?></div>
Then at the top of the page, I created my “basket” — just a stylized div with a “droppable” class or id, like so:
<div id="basket" class="droppable">Drag items of interest here.</div>
Then in the document ready function, just initialize the drag and drop:
$('.draggable').draggable({ revert: 'valid'; });
$('#droppable').droppable({
accept: '.draggable',
hoverClass: 'draggable-active',
drop: function(event, ui) { doSomeFunction(ui.draggable); }
});
Demo coming soon…
By beyondthewheel
Recently I was working on a project where I had a central Cake application for a group of clients and each client had their own database.
I wanted to have all users sign into a central user’s table associated with the application, but then for the bulk of the controllers in the app have the database config change based on a field in the user record.
So if Bob Smith from Company A signs in to our app, he needs to use database configuration ‘company_a’.
Since we are using Cake’s built in Auth component, we always have access to the user record in the Session from the controller. But for the life of me, I could not figure out how to get at the Session data from the Model!
I saw several comments in my search that said to just abandon the Cake MVC model and get what I needed from $_SESSION. I had no qualms about doing that, but $_SESSION had no data. I believe this is because Cake overrides PHP’s default session handlers so session data stored by Cake is not going to end up in $_SESSION. Feel free to comment if I am wrong about that.
So I had the data I needed in the controller, but at that point the model has already been instantiated.
But it became a timing issue — ‘mydatabase’ had to be a valid database connection before the controller is even instantiated.
So to fix, a ‘dummy’ database was needed to make the initial connection, then we can make our adjustments in the controller.
function beforeFilter() {
$config = array(
'login' => 'myusername',
'password' => 'mypassword',
'database' => $this->Auth->user('company_name')
);
$db =& ConnectionManager::getDataSource("mydatabase");
$db->disconnect();
$db->setConfig($config);
$db->connect();
}