Codeistry

May 4th, 2009

Choosing syntax highlighting colours for the draw spaces Gedit plugin

I’ve recently upgraded to Ubuntu Jaunty – and therefore Gedit 2.26.1 – and I couldn’t figure out how to change the color of spaces shown by the ‘Draw Spaces’ plugin. This used to be set in the plugin configuration, but you now do it in the syntax highlighting theme – but how? What do you need to add?

The closest that I got googling was this: https://bugs.launchpad.net/ubuntu/+source/gedit-plugins/+bug/348500 – which almost tells you but misses out the crucial bit of info.

So, I asked the fine folks in the #gedit room on irc.gnome.org and they enlightened me; you need to add this to your syntax theme file:

<style name="draw-spaces" foreground="tinted_grey"/>

Where tinted_gray is one of your theme’s colours. I would put it at the top somewhere, with the rest of the global stuff. You can look in the cobalt.xml file in /usr/share/gtksourceview-2.0/styles for an example of a theme which does this. I thought I’d put this here so anyone else who get’s stuck trying to change this has a better chance of Googling an answer.

Download a modified version of the Gedit Twilight Theme, with this tweak added. To install, put the file into your ~/.gnome2/gedit/styles/ folder and restart Gedit. Then just select the Twilight theme in Preferences.

April 10th, 2009

MySQL Workbench 5.1.10 beta

The new MySQL Workbench is now in beta and is looking very good:

MySQL Workbench 5.1.10 showing a MODx 0.9.6.3 databaseYou can import create scripts (mysqldumps), build diagrams yourself, with full drag and drop etc, and export create scripts. You can also annotate with text and images and export the diagrams as SVG, PDF, PNG etc… Here’s the PDF for the MODx 0.9.6.3 diagram shown, along with the MWB (workbench) file. That diagram is just an imported mysqldump of a MODx DB – all I did was click the auto-arrange button.

It’s available for Linux (32 & 64 bit), Mac and Windows. I’ve been playing with the 64bit version in Ubuntu and it seems to work great! More info on their blog, or get it here: http://dev.mysql.com/downloads/workbench/5.1.html

April 10th, 2009

gcalc: a command line version of Google Calculator

Here’s a command line version of Google Calculator:gcalc command line tool in use

Download gcalc here: http://www.codeistry.com/assets/files/gcalc.zip

Using Google Calculator in firefox's search box.It’s a little python script that talks to Google, using it’s calculator syntax. You’ll get the same answers if you type the queries into google

To use the script, just download the zip file, extract the file inside and put it somewhere on your path; I’ve started putting these kind of things in ~/bin. I originally found the script here (http://vrai.net/page.php?block=scripts) but it didn’t work too well, so I fixed it up. I’ve tested it on Linux, but it should work anywhere Python is installed.

If you’re using that script on Linux, then chmod +x gcalc it to allow it to be executed. If you’re using Windows, you might have to add ‘.py’ to the end of the filename. Then the syntax is very simple:

gcalc “1 hour 5 minutes in seconds”
1 hour 5 minutes = 3900 seconds

gcalc “100 + 2 * 5″
100 + (2 * 5) = 110

gcalc “41000 yen in british pounds”
41,000 Japanese yen = 277.129372 British pounds

Here are complete instructions on the syntax that Google Calculator supports.

Also, in the screenshot above I’m using Fish, the Friendly Interactive SHell because it does nice syntax highlighting, amongst many other cool things. Fish is here, if you want it.

Have fun!

April 3rd, 2009

Bunch of updates to the Codeistry site

I’ve made a number of small updates to the Codeistry site today, which I’ve been queuing up on my local version for a while. I’ve made updates and corrections to my Accessibility made simple article, as well as minor updates to the 9 Steps to Improve your Small Business website and SEO for Fun and Profit ones.

Screenshot of MODx metadata field in page editor.I’ve also souped up the metadata that gets output in the page’s code, so that I’m now outputting a meta description tag – this outputs whatever I’ve typed into the page’s Description field in MODx.

Screenshot of the MODx Meta Keywords systemI’ve also started using MODx built in meta keywords system, so some pages now have some keywords set.

A little while age I also added a Creative Commons license to the page footer but forget to mention it on the blog. This means that the site’s content is now actually marked as copright of Codeistry now – which it wasn’t before. As I’ve chosen a Creative Commons Attribution Non-Commercial Share Alike license, this also means that anyone can re-use, re-mix, translate or re-purpose any of the stuff on here for whatever they want, provided it’s non-commercial and they credit the original source.

Anyway, here’s the old footer:

Screenshot of the old Codeistry page footer, before the new license

and here’s the new one:

Screenshot of the Codeistry page footer, with the new Creative Commons license

March 26th, 2009

9 Steps to Improve your small business website

As a web designer & developer, I see a lot of websites, many of them belonging to small businesses. I’m also an independent, running my own business – my website is my shop window, so this subject is close to my wallet heart. There are some common things missing in a lot of the websites that I look at, things that would really improve the website and make it work harder for its owner. Fortunately, most of the missing bits are fairly easy to add.

This list is intended to make you think about your own website and give you practical, actionable steps that you can take right now to improve things. None of these things are difficult and most of them can easily be done in an hour or two. Print this off, mark the ones that you think you need to work on, and tick off one a week.

See the 9 Steps to Improve your small business website article for the steps!

Codeistry blog is proudly powered by WordPress Entries (RSS) and Comments (RSS).