thecrumb

developer, thinker, tinkerer

Review Board on VirtualBox

For my upcoming cf.Objective() presentation on code reviews I needed to setup a working copy of Review Board. I’ve done this before and the installation isn’t too bad, but could be easier. Enter Bitnami who now offer a Review Board ‘stack’.

Read on →

Sublime Icon in Ubuntu Unity

This is more for my reference but others may find it useful.

  • Ubuntu 11.10
  • Sublime Text 2

I’ve downloaded and unzipped Sublime into:

1
/home/jim/Programs/sublime

To add an icon to the Unity menu create the following file:

1
/home/jim/.local/share/applications/sublime.desktop

And populate it:

1
2
3
4
5
6
7
8
9
[Desktop Entry]
Name=Sublime Text Editor
Comment=Sublime Text Editor
Exec="/home/jim/Programs/Sublime/sublime_text" %F
MimeType=text/plain;
Terminal=false
Type=Application
Icon=/home/jim/Programs/Sublime/Icon/256x256/sublime_text.png
Categories=GNOME;GTK;Utility;TextEditor;Development;Utility;

Adjust the Exec and Icon paths accordingly.

Now if you hit the Unity menu and begin typing “Sublime…” the Sublime icon will appear.

Octopress Migration Complete

My WordPress to Octopress migration is complete.

I won’t say it was easy. The conversion script did a fairly good job but there were some issues.

The biggest issue was over the years I had used several code formatter plugins with Wordpress. Unfortunately the early versions of those appear to have botched up the code resulting in a lot of my early Ant posts being mostly useless. I thought initially the import script had screwed things up but I dug into my original WordPress XML export and things were missing there as well.

I will dig around and see if I can re-create those posts but I’m doubtful I can recreate all of them.

Next I’ll try to condense my experience trying to get Octopress running on Windows.

Octo What?

Welcome to 2012.

I’ve been using WordPress for a long time. Before that was MoveableType, a short stint with Drupal and Joomla, Geeklog and old fashioned hand rolled pages.

I’ve been wanting to change things up lately. WordPress is getting bloated. I was looking in Jekyll when I stumbled across Octopress. I tried for a few days to get it working on Windows, and did manage to get it working (sort of), but it’s much easier on Linux (and I imagine a Mac). I’ll try to blog about my setup soon.

I’m still working on tweaking things, and I have a load of old posts to comb though and clean up.

I’m also working on some Octopress snippets for Sublime which will make inserting images, etc much easier.

Sublime Text 2 - Shell-Turtlestein Package

Update: This is now available via Package Control…

Since switching to Sublime I’ve been using the command line much more.

I’ve blogged about how to easily access the terminal from within Sublime.

Recently I discovered the Shell-Turtlestein package which makes it even easier to run quick commands.

A quick and simple way to run arbitrary shell commands in Sublime Text 2.

CTRL+SHIFT+C will popup a small prompt for a shell command at the bottom of the Sublime window.

And If you hit CTRL+SHIFT+ALT+C it will launch a terminal window giving you the same functionality as the “Terminal” package mentioned above.

I find this great for doing things like SVN STATUS.

Shell-Turtlestein isn’t in Package Control yet but can be found on github here: https://github.com/misfo/Shell-Turtlestein

Sublime Text 2 - Dev Builds

If you are using Sublime Text 2 - there is a ‘dev’ build available here: www.sublimetext.com/dev

  • Current Beta: 2165
  • Current Dev: 2176

This is updated almost daily and includes new features as well as bug fixes. I’ve been using it for the last few weeks and have had only 1-2 crashes and some of the features like autocomplete and autoindent are well worth it!

My Standing Desk

spacer

Many years ago, when I was drafting for a living, I stood at a table much like this one for most of the day. I had a stool but when working on large drawings standing was usually required.

Then along came Computer Aided Design (CAD) and we all ended up sitting passively in front of computer screens.

Fast forward to present day. Keep going… I’ve been sitting a long time.

I’ve been following the ‘standing desk’ idea now for awhile. A few months ago my wife was redecorating her office and we had a trip to Ikea on the horizon so I spent some time on ikeahackers.net and came up with some ideas.

spacer

In Ikea I wandered around the store and finally settled on the Billsta bar table. At least the legs anyway. The table top was a bit too small. I replaced that with one of the bigger desktop surfaces they had available.

The general rule among standing desk experts is the table top should be at about elbow level. The Billsta is just a tad too short. Right now I have it resting on a few 2x4s and may even raise it a bit more.

spacer

For the most part if I’m at my desk at home I’m standing, usually for several hours a night. If I work from home I can go til about mid-afternoon at which point I usually have to sit for a bit. I did pick up a folding stool at Ikea for when I need to rest my feet. The first week or so my feet and back hurt. I do recommend wearing shoes while standing and get an anti-fatigue mat to stand on (you can find these at Lowes or Home Depot).

spacer

The last bit of the puzzle was what to do with my monitor and laptop. Standing requires the monitor to be much more elevated off the desktop than sitting. I surfed Craigslist for while and found someone selling some monitor arms. This allows me to free up my entire desk surface giving me much more space, and if I sit I can adjust the arms accordingly.

I haven’t lost any weight (I blame the holidays) but I do feel much better since starting to stand. If you’ve been thinking about trying it there are many ideas on the web on how to inexpensively get started. Next I’m going to investigate hacking up some sort of standing configuration at work.

spacer

OpenCF Summit

OpenCF Summit is one of those conferences that I want to attend but life always seems to get in the way.

I won’t be able to make it again this year but that doesn’t mean you can’t go! :)

For a whopping $72 you get not one, not two, but three days of open source, CFML goodness…

  • OpenBD? Check.
  • Railo? Check.
  • Mura? Check.
  • The opportunity to discuss open source CFML with the people who are building it! Check.

I haven’t looked at either the schedule or speakers (I don’t want to get depressed) but I don’t have to.

Why? Because of the fantastic team who is organizing OpenCF Summit. Organizing a conference is a lot of work but I know folks like Matt, Kurt and Peter are passionate about what they are doing and the sessions and speakers they have lined up are going to be great.

I blogged about open source CFML back in 2009 and I think it’s great to see open source CFML thriving!

No longer are these merely fancy product titles floating around behind an open source idealogy. Now we have some big community members throwing their support behind the concepts! And I know these people will not let these products wither and die. They are all passionate people who have the best in mind for CFML and Iā€™m so excited to come along for the ride!

OpenCF Summit is taking place on Feburary 24 - 26, 2012, at the Special Events Center in Garland, Texas.

Register today!

Projects in Sublime Text 2

In the past I’ve always been working on just one project so I have never explored ‘projects’ in Sublime Text 2.

Today I needed to work on multiple things so I broke down and discovered how projects work. Like everything else in Sublime they are very simple, and offer a lot of flexibility.

Step one is to create a new project. You do that by simply adding a folder.

Project > Add Folder to Project…

Your project files and folders should now be displayed in the sidebar.

Now save your project.

Project > Save Project As…

This will create two files:

  1. your_project.sublime-project
  2. your_project.sublime-workspace

From the Sublime Text 2 documentation:

Projects in Sublime Text 2 are made up of two files: the sublime-project file, which contains the project definition, and the sublime-workspace file, which contains user specific data, such as the open files and the modifications to each.

As a general rule, the sublime-project file would be checked into version control, while the sublime-workspace file would not.

The sublime-project file allows you to make project specific configurations to Sublime. You define multiple folder paths as well as specify folders and files you want to exclude from view. You can also define per project Settings for Sublime:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
{
    "folders":
    [
        {
            "path": "wwwroot",
            "folder_exclude_patterns": ["images"]
        },
        {
            "path": "c:\wwwroot\project1\assets",
            "name": "Project 1",
            "file_exclude_patterns": ["*.php"]
        }
    ],
    "settings":
    {
        "tab_size": 8
    }
 }

Here we’re defining two folders. The ‘name’ attribute will define the name that is displayed in the Sublime sidebar for this folder. This is helpful if you have a long path or folder name and want a more descriptive label.

Once you have multiple projects setup, you can easily switch between them by hitting CTRL+ALT+P. That will bring up a dialog of all defined projects. You can either click on the project or start typing a project name to apply a filter.

I’m still learning how best to use projects but I like the flexibility of defining multiple folders and being able to specify the path. I’m working on a project now with many deeply nested subfolders and can simply map to a specific directory instead of having to click down through several folders.

Sublime Text 2 - Format SQL

I’ve posted before about formatting SQL in my IDE. I always inherit code where the previous developer formats their SQL different than I like. Currently I’m suffering from ALL CAPS SQL.

1
SELECT INT_SUB_ID FROM INT_SUBCATEGORY WHERE INT_CAT_ID = 123

My eyes! My eyes!

I immediately hit Package Control in Sublime and sure enough there is a SQL package: Format SQL.

After installing (and restarting Sublime) you have a new option under Selection. Format > Format SQL Statement.

This got the indention correct but I was looking for some case changes:

1
2
3
SELECT INT_SUB_ID
FROM INT_SUBCATEGORY
WHERE INT_CAT_ID = 123

Looking at the python-sqlparse library documentation there are some statements to change case for keywords and identifiers. So I cracked open \Sublime Text 2\Packages\Format SQL\FormatSQL.py and found this line:

formatsql.py
1
return sqlparse.format(s, keyword_case="upper", reindent=True, indent_width=indent_size)

And modified it like so:

formatsql.py
1
return sqlparse.format(s, keyword_case="upper", identifier_case="lower", reindent=True, indent_width=indent_size)

And now I get:

1
2
3
SELECT int_sub_id
FROM int_subcategory
WHERE int_cat_id = 123

Done!

← Older Blog Archives
gipoco.com is neither affiliated with the authors of this page nor responsible for its contents. This is a safe-cache copy of the original web site.