Howsthe.com Blog

Avatar for vbabiy@howsthe.com

Gedit Open Files with Multi-window support

Published July 27, 2010 by Vitaly Babiy

Recently I took some time to rewrite the gedit-openfiles plug-in and also added one big feature. Before I get in to the details of the new feature I wanted to give a brief description of what the plug-in does.

gedit-openfiles uses the root of the file browser to index all the files in the working directory and sub directories. Doing this allows for quickly searching with in your project. The plug-in was designed to handle very large projects, I have personal tested it on a project with 4,000 files and it worked perfectly.

Image

The new feature to the plugin is it now supports multiple windows. If you are working on a project in a gedit window and you open another window to work on a different project, when opening gedit-openfiles (ctrl+alt+o) in a window it will only search files specific to that window (screen cast demo below).

Gedit Open Files from Vitaly Babiy on Vimeo.

You can find the plug-in on github http://github.com/vbabiy/gedit-openfiles, enjoy!

Tags
  • gedit
  • gedit-openfiles
Avatar for vbabiy@howsthe.com

MySQL Quick Tip: Clear query cache

Published July 26, 2010 by Vitaly Babiy

I was working with mysql today and I needed to clear the query cache (without restarting the server :)). The following statement does just that:

RESET QUERY CACHE;

Thats all, enjoy.

Tags
  • mysql
  • quicktip
  • sql
Avatar for vbabiy@howsthe.com

jQuery Object Oriented Event Handling

Published April 13, 2010 by Vitaly Babiy

Using jQuery, its easy to write event handlers for all kind of events that can occur in the DOM. It gets a little harder when the callback function is part of a object, and you want the function to have access to the object using this.

In jQuery you write a event handler as the following:

function clicked(event) {
    alert(this)
}
$("#element").bind('click', clicked)

The this variable is going to contain the element that triggered the event.

Tags
  • Event
  • Handlers
  • Javascript
  • JQuery
  • OOP
Avatar for charles.boyung@nexustechnologiesllc.com

jQuery Twitter Library

Published April 7, 2010 by Charles Boyung

The world of jQuery is kind of like the iPhone app store. Just like “there’s an app for that”, if you want to do something specific with jQuery, there’s probably a plugin for it. And just like the iPhone app store, the quality of the items you find can vary from utter garbage to brilliant masterpieces. The jQuery Twitter library known as jTwitter falls somewhere in the middle. It has some decent functionality, and can definitely prove useful if you aren’t able to make use of any of the more robust options out there (such as any of the server-side libraries or the API itself).

What it Does
jTwitter does one thing: it allows you to retrieve and display recent Twitter posts for a specified Twitter user. The demo provided is a good starting point, but it only goes as far as showing you the basics of querying for posts and displaying the results. I’m going to take this a step further and show you how you can extend this with additional Javascript to make the results somewhat more useful. To better follow along with this tutorial, I recommend downloading the full tutorial source.

Avatar for vbabiy@howsthe.com

An Outsider's Perspective

Published March 31, 2010 by Vitaly Babiy

Rob Walling from http://www.softwarebyrob.com/ had recently posted a request for businesses to submit their site for a quick review, I submitted howsthe.com in a heart beat. I have to thank Rob again for taking the time to record the review. The video will be video embedded after the break. I want to take this time and talk about how important an outside perspective is.

I want to first go over a couple of the suggestions Rob had pointed out in the video which were just so obvious in hindsight. I will start with the quick check tool, its a great way for people to see how the service works, and it is used by many users everyday. Which is awesome, but once the user see the result of the website check there is no actionable item to help the user flow through to the sign up page. Rob has suggested that I add a workflow from the result page to the sign up section, this is just brilliant and yet so obvious. It just goes to show how important it is to get feedback from people that are not working on the product everyday.

Tags
  • great-products
  • reviews
Avatar for vbabiy@howsthe.com

Stream mic to speakers on Ubuntu 10.04

Published March 30, 2010 by Vitaly Babiy

Quick Tip:

To enable a loopback to your speakers from your mic, this is helpful for screencasting and recording audio.

pactl load-module module-loopback
Avatar for vbabiy@howsthe.com

Crockford on Javascript

Published March 29, 2010 by Vitaly Babiy

Douglas Crockford is giving a public lecture on JavaScript, the link is below. Anyone that is interested in JavaScript or is using it (really any web developer) should watch them.

Douglas Crockford

Douglas is the author of one of my favorite book JavaScript: The Good Parts Amazon Link

http://www.yuiblog.com/crockford/

Avatar for vbabiy@howsthe.com

Moving Gnome panel with a dual screen setup

Published March 26, 2010 by Vitaly Babiy

Quick Tip:

Moving the gnome panels around on a dual screen setup. Click on the panel you want to move while holding ALT and drag to which ever screen you desire.

Enjoy.

Avatar for vbabiy@howsthe.com

MongoDB and V8

Published Feb. 22, 2010 by Vitaly Babiy

If you haven't heard of mongoDB, its a fast schema free document store. MongoDB uses Javascript as its query langauge, and uses a derivative of JSON called BSON for storing data. Currently the JavaScript engine used is spider monkey (Developed by Mozilla). If you checkout the lastest version of mongoDB you will be able to build it with Google's V8 JavaScript engine support. The V8 engine powers Google's new chrome browser, using this engine with mongoDB should give an amazing speed boost. This article will walk you thourgh building both V8 and mongoDB with V8 support on Ubuntu 9.10 32bit (64bit should be very similar).

First you will need to checkout the V8 engine source code. More information can be found at http://code.google.com/p/v8/. Before we checkout the code you will need a few tools and libraries.

sudo apt-get install subversion git-core tcsh git-core scons g++ libpcre++-dev
sudo apt-get install libboost-dev libreadline-dev xulrunner-1.9.1-dev
Avatar for vbabiy@howsthe.com

Datetime mocking with pyxmox

Published Feb. 11, 2010 by Vitaly Babiy

This is a reference on how to mock out the datetime.now() call in python using mox. Since datetime is a built-in it makes things a little more tricky.

def test_datetime(self):
    now = datetime.datetime.now() # Store it for later use
    m.StubOutWithMock(datetime, 'datetime')

    datetime.datetime.now().AndReturn(now)

    m.ReplayAll()

    datetime.datetime.now()

    m.VerifyAll()
    m.UnsetStubs()

First we will store the current datetime, this has to be done before mocking takes place. Next we use StubOutWitMock to mock out the datetime class, we then record the call to now and have it return our stored now. If you have any question leave them in the comments.

Links:

A blog about development, marketing, and design.