GITY: A FAST, NATIVE GIT REPOSITORY BROWSER FOR LINUX
Over the last two months I built my first desktop application: GitY. It’s a simple read-only Git browser for searching and viewing a repositories commit history. Useful for browsing a Git repository in a desktop app without wrestling with a heavyweight IDE. It’s a simple, fast, and built for developers who prefer native Linux tools—and it excels at two things in particular: search and speed. For reasonably sized repositories most operations will be near instant. Don’t wait for slow tools when better options exist!
ASKING GREAT QUESTIONS IS A SUPERPOWER
I’m sure this situation has happened to you: you’re in a meeting with a group of people and it seems like no progress is being made on how to proceed until someone asks a really great question and everyone goes silent. That is the power of asking a great question. A great question gets at the underlying assumptions and aligns multiple perspectives on the problem. It’s also a great tool for effective leadership. I wrote this post to reflect and consider how I can ask better questions because it’s a skill that can be developed. Before we get into the how, let’s start with the benefits first.
EFFECTIVE INTERVIEWS
Do you remember the last time you were in an interview? Did you enjoy it? Did you tolerate it? Or did you secretly wish it wasn’t happening? Interviews are notoriously unpleasant for the interviewee and sometimes for the interviewer as well. In the last 13+ years I’ve conducted many interviews, from those that were incredibly awkward to those that were quite enjoyable. Leaning on my experience let’s dig into what makes an interview productive and what both parties can do to make the whole process a bit more pleasant.
RESIGNING FROM YOUR DAY JOB
Last week I wrapped up my employment at Policy Reporter. It was bittersweet to leave a company where I got to play such a big role. During my time we saw tremendous business growth, hired and formed a management team, and had a successful exit when Policy Reporter was acquired by TrailCard. I also had the privilege of hiring and growing an amazing Engineering team, working with a lot of incredible people, form new departments, re-building the technical foundations of the product, building new products, and creating a culture where everyone is respected, friendly, open to learning together, and always looking for ways to get better. As I was preparing to leave I was told the team embodies my value of us all becoming better humans (a deeply held belief and purpose of mine that I didn’t realize had seeped out). I’m sad to have left and I still miss engaging with my team daily.
UPGRADE TO GIT
Remember when Subversion was the new tool that all the cool kids were flocking to? Well, Subversion is now the old and busted, and it’s time to move to Git. It’s time to upgrade your Subversion repo (if your still using it) to Git because of the benefits you will gain from moving to a more flexible tool. Distributed: When you checkout (or clone in the git world) a repository, you are checking out all the files in the repository, which means you can work independently of others. You can commit and make changes on master, or another branch without imposing your incomplete changes on the rest of the team. Simple Merging: Compared to Subversion, merging is fun. Because its so easy, as a developer you are more inclined to make additional branches and use them as they should be used. This adds a lot of flexibility in where and when the changes are pushed to master. Speed: A subversion commit doesn’t end until all the files have been transferred to the remote server, with git, commits are completed instantly because you are committing to the local repository, not the remote one. Therefore, you don’t have to wait for actions to complete as they are almost instantaneous. I could go on, but those are the big ones for me. Note: I’m not against other DVCS systems like Mercurial, Bazaar, but I chose Git because of it’s popularity and ability to handle the Linux kernel.
CACHE PASSWORD PROTECTED WEBSITE
I needed to write a simple web app to automatically cache a password protected tumblr admin account, so I wrote simple symfony app to do it. It was pretty simple to do because I could leverage the sfWebBrowserPlugin which provides most of the heavy work for simulating a browser and logging into the site. While this project is setup to cache tumblr, you can easily modify it to cache any website. It’s built in PHP on the symfony framework.
WORDPRESS NEEDS A DEFAULT CACHING PLUGIN
I find it curious that WordPress, one of the biggest and best blogging platforms currently around does not come default with a caching plugin. I think the WordPress developers should either include one of the excellent WordPress caching plugins, or build their own and then enable it by default. Users and blog hosts worldwide would have better page load performance and improved scalability. This blog is build with WordPress, and in my first year of blogging, one of my posts received a lot of hits. Unfortunately, the default WordPress install I had setup wasn’t able to cope with the demand effectively. It was taking 2-5 seconds for visitors to load a page. That’s unreasonable for a simple blog and I’m sure I lost a lot of visitors because of it. So I looked into ways to make my blog load faster without paying extra for better hosting hardware. That’s when I found an excellent caching plugin called Hyper Cache.
SANITIZE USER INPUT FOR XSS IN PHP
The best way to sanitize any input from your user (in PHP) is to use the HTML Purifier library. HTML Purifier will remove any XSS from your code, produce valid HTML, and generally make you sleep just a bit safer at night. It doesn’t completely sanitize user input, and you still need to be careful with it before using it anywhere (such as an SQL statement), but it will remove all XSS attacks against your website.
YII OVERRIDE COMMAND PARAMETERS
The Yii Framework is very flexible and has a variety of way you can configure it. Here I will show you how you can customize parameters on a Command task. The default Yii Migration command asks the user for a confirmation before running if there are any tables that have been changed, this is quite a sensible default, but I don’t want to be asked if the command should be run after a deployment. Of course it should be.
HOW TO ADD LOCAL CONFIG VARIABLES TO YII
Often times you want to be able to specify configuration parameters or settings that only apply to a single environment. These local configuration don’t need to, and shouldn’t be entered into version control, and should over ride default values. I needed a solution for a project I was working on so I wrote one for Yii. The main configuration file protected/config/main.php returns an array of parameters. Edit this file to merge 2 arrays, 1 from main.php, and another from local.php.