Tracks and Basecamp

Posted by Trey Connell on August 08, 2010

I started working today on integrating Tracks and Basecamp for the heck of it. So far it’s coming together pretty well. You can check out the latest where I forked Tracks on github.com. The project integration is done, and to-do lists are up next. Shouldn’t take much longer. I’m not sure exactly how useful it will be at this point – but hey – I’m adding options for folks using Tracks. And it’s fun!

A Few Git Tips You Didn’t Know About

Posted by Trey Connell on August 02, 2010

Mislav posted some really good tips for using Git.

http://mislav.uniqpath.com/2010/07/git-tips/

JQuery Tools from Flowplayer

Posted by Trey Connell on April 09, 2010

I long ago decided to use JQuery over other javascript frameworks like Prototype. JQuery just seems to fit with the way I think about solutions and how to attack challenges. I also think the community is amazing, with many new tools and tutorials and exciting APIs springing up everywhere.

One such tool is from Flowplayer and is called, simply, JQuery Tools. In short, JQuery Tools is an implementation that provides easy to implement:

  • Tabs
  • Tooltips
  • Expose′ Behavior
  • Scrollable Areas
  • Flash Embeds

The demos and code examples on the site are easy to follow and fun to play with. If you’re looking for a nice library for common UI effects and elements, take a look at JQuery Tools from Flowplayer.

Simple Captcha for Ruby on Rails

Posted by Trey Connell on February 01, 2010

ruby on railsI wanted to implement a simple captcha for for article comments on a site. And by simple, I mean both in aesthetics and in functionality. After looking around, I found this post that described how you could implement a plugin called Simple Captcha in 10 minutes or less.

The plugin requires RMagick and ImageMagick which takes a little while to install.  So if you don’t have those, then the title of the post probably won’t hold true for you.  After you have everything installed, it takes one line of code in your view and one line of code in your controller to implement the captcha.

Just what I was looking for!

Low Budget Web Development Training

Posted by Trey Connell on November 20, 2009

ruby-rails-tutorials-screencasts-smallruby-on-rails-ebooksI purchased the annual subscription to peepcode.com which gives me access to all screencasts and PDF eBooks they offer for one year. If they add new material after I purchased, I still get access to it – as long as my 1-year subscription hasn’t expired. I’ve found the screencasts to be of great quality and very helpful for introducing me to new concepts, languages, and tools. It’s really nice to sit back with a cup of joe and watch an instructor sometimes, and these guys do a great job.

The Pragmatic Programmers write some of the best development books out there. The great news is now they offer everything in electronic format – including PDF, .epub (eBook), and .mobi (mobile version). At an average cost of around $24 for all 3 electronic versions, these books are a steal. Also, there is no DRM and the Pragmatic Programmers site states that you are free to distribute the files to other members of your team. I purchased around 10 books and simply placed them in a secure location for our team to download.

All in, I spent about $400 for a wealth of knowledge and portable information that I can distribute to our team. That’s hard to beat when you’re trying to continue and encourage the growth of your employees but the economy is telling you to take a hike.

Sometimes We Forget That WE Are The Experts

Posted by Trey Connell on October 23, 2009

expertAs creative and talented people, web designers and developers sometimes get into a funk – usually called “burn out”. I believe much of that funk can be attributed to their ever-dwindling patience with the very people they are there to serve – the customers.

It doesn’t matter if that customer is internal or external to your organization. Your job as a creative is to articulate the value of what you are proposing. And not only that, you also have to describe the process you’re going to follow in order for both you and your customer to achieve success. Finally, you have to make the sale and convince them to pay your price. That could be the internal time frame you need or real greenbacks. Sounds straightforward right? Well, it’s not.

I believe much of our frustration comes from customers who think they already know how it should be done, what’s involved, and ultimately devalue our contribution to the project. How many times have you had a customer deliver a document describing what they want on the home page of their site only to then have them turn around and say designing that home page should only take a few days because they’ve “practically done all the work already”.

What about when you build a new feature that does X but then the customer decides they want it to do Y. It’s all fun and games until the customer then asks you to revert back to X. Furthermore they think because X was already built, it’s basically like simply changing lanes on a highway or making a U-turn. “You should be able to have X back in place this afternoon right”? Slow down sparky.

Now it’s your job to explain how that code was branched a long, long time ago and you’ll have to merge it back into the product months later when 9,000 other things have been added since then. Then you’re going to have to run your testing routines and possibly do manual regression tests on the entire system to ensure you haven’t borked everything. Then THEY are going to need to test it and approve it for production launch because their idea of X 3 months ago is probably not going to be what they think X should be today. As you know, the list of details goes on and ultimately you spend 8 hours putting something in place that the customer thinks should have taken 15 minutes.

Circling to my original point, if you can’t properly and effectively communicate what you are doing, why you have to do it, the processes involved, and WHY YOU KNOW BEST AS THE EXPERT ON THE PROJECT then you’re setting yourself up for some major frustration. In my experience, customers just don’t know what they don’t know. If you take the time to explain it to them and justify what you already know is the correct approach, you’ll find your working relationship with them will improve and they will start to question less and move forward more.

Migrating from Java to Ruby on Rails

Posted by Trey Connell on October 23, 2009

java-versus-ruby-on-railsWe use Java as the foundation for our product framework at work. While we’ve always been pleased with Java compared to the P’s in LAMP (PHP and Perl), I’ve often wondered, “Is there an easier way? Do we really need all these pieces and parts that make up our stack? Can we build sites faster and with more predictable results?” While I think Java is a fantastic language, I think it tries to be all things to all people. We don’t need to write embedded systems. We don’t need to tie together disparate systems with middleware. We don’t need massive EJB deployments. We need to build feature-rich, dependable, scalable, and beautiful web sites. And we need to build them yesterday quickly.

Enter Ruby on Rails. I’ve been using Ruby on Rails outside of work for about a year now. The first thing I will say is that it’s FUN. At my age I don’t want to futz around with bits and bytes, memory allocation, and the like. Ruby on Rails seems to let me focus on building cool stuff and not on wrestling with the framework to bend it to my will.

The second thing I’ll say is it’s easy to get up and running and to deploy changes to your applications. We have a very intensive build and deploy process surrounding Java and our sites. Nothing makes me more frustrated than spending 30 seconds to fix a typo and having to go through a 15 minute deployment process. With Ruby on Rails, that pain point goes away since I can make changes to my code or my templates and simply refresh my browser to see those changes.

The last thing I’ll say is that I’ve been using Java for a long time and part of my infatuation with Ruby on Rails may simply be due to the fact that it’s new and exciting. Regardless, we’re going to continue to explore the Ruby on Rails framework for our next major iteration of our product. I think at the very least that it’s a good exercise, and we may just find that we need to take the plunge and move away from Java for our future web development efforts.

WORDPRESS ALERT – Admin Privileges Unchecked in Older Versions

Posted by Trey Connell on August 10, 2009

I had been rocking along with an older version of WordPress for about 2 months now – 2.7.1 to be exact. I was hesitant to upgrade to the latest release which as of this time is 2.8.3. I knew that several plugins would be broken if I attempted to upgrade so I had been busy contacting the plugin authors inquiring about new releases that were compatible. Boy, did I learn my lesson.

I came to my site last Thursday morning to find the URLs were completely screwed up. I went into the permalinks tool and noticed my configuration had been modified to include a bunch of javascript garbage in the URL. Some ass clown had undoubtedly changed this setting in order to gain further access to my site or the server it’s hosted on.

After investigating, I found no further damage, but I was left wondering how in the world someone could have gained access to that admin tool within WordPress. I soon found the answer here. The article by Core Security Technologies identifies and describes how someone can gain unfettered access to some core admin screens as well as configuration panels for plugins by simply modifying the URL.  Specifically – inserting an additional slash before the php file name causes WordPress to bypass the privilege system checks. Not good and so simple it’s really quite horrifying.

After fixing my site, I was still loathe to upgrade WordPress without testing everything first. The phrase “bull in a china shop” comes to mind. So instead, I put in a bit of Apache mod_rewrite magic:

# Remove double (or more) slashes from the URL.
RewriteCond %{REQUEST_URI} ^(.*)//(.*)$
RewriteRule . %1/%2 [R=301,L]

So I had Apache protect me while I went about the process of (sanely) upgrading and testing my WordPress installation and plugins. As of today, I’m all happy on version 2.8.3, but I definitely will be paying more attention to security notices from now on.

Add Thumbnails to WordPress Posts

Posted by Trey Connell on May 26, 2009

I’m working on a project in WordPress for a customer who wants to have 3 images associated with each post. One of the three images will display depending on the position of the post on the home page. The typical solution is to use custom fields but that is very awkward and not efficient at all. I came across a fantastic plugin called WP Post Thumbnail and so far it’s exactly what the developer ordered.

The WP Post Thumbnail plugin adds a new panel to your Post editor where you can upload and crop up to 3 images. The images are stored in the database just like any other custom field values so all the same retrieval methods apply.

If you think this plugin might work for your projects, go download it.

WP Post Thumbnail Plugin Panel

WP Post Thumbnail Plugin Panel

Automatically Insert Text in a WordPress Post

Posted by Trey Connell on April 22, 2009

Sometimes you want to automatically insert copy into the body of your WordPress post without having to manually paste it in every time. I ran across this handy function from wprecipes.com that does just that:

Edit your theme and paste the following code into your functions.php file:

add_filter( 'default_content', 'my_editor_content' );

function my_editor_content( $content ) {
    $content = "I want this text to be automatically included.";
    return $content;
}
?>

Free Screen Captures in any Browser

Posted by Trey Connell on February 04, 2009

Browser Shots

Web developers and designers all know what a PITA it is to test their work across multiple browsers. At the very least, you’re typically dealing with Internet Explorer 6 and 7 (and soon IE 8 is coming out), Firefox 2 and 3 (on both Mac and PC), and Safari (Mac and PC). Some even look at browsers like Opera and Konqueror. Now, Google Chrome is on the rise and may be yet another browser we have to take into consideration.

I found a site that is tremendously helpful for testing across all browsers – browsershots.org. You can choose all the browsers you want to capture a screen grab for and enable things like javascript and flash. After making your selections and submitting a URL, you have to wait anywhere from 2 to 20 minutes for your jobs to process and the screenshots to appear.

What makes this site really great is the fact that it’s FREE. BrowserShots isn’t going to let you do full cross-browser compatibility QA for a site, but it’s great for checking your design and layout and making sure it’s not completely borked in something like IE 6.

Create HTML from Code with TextMate

Posted by Trey Connell on January 31, 2009

TextMate is a very popular text editor with a lot of features and “bundles” (think “plugins”) that runs on Mac OS X. TextMate contains an often overlooked feature for creating nice html versions of your code for display on your site. In order to do this, follow these steps:

1. In TextMate, go to Bundles -> TextMate -> Create HTML from Document. You can also Create HTML from Document with Line Numbers.

Create HTML from Code with TextMate

click to enlarge

 

2. You’ll see a new file appear. This is a normal HTML file that contains all the CSS needed to duplicate the color scheme and styling of your TextMate theme.  (I’m using the “All Hallow’s Eve” theme)

textmate-html-source-code

click to enlarge

 

3. You can copy and paste the CSS code into a new css file that you include in your site or blog. Then simply copy and paste the source of the code itself (everything between the beginning and ending <body> tags) into your page or post. Try not to pay too much attention to the HTML that’s generated – it’s definitely messy but it does work.

If all goes well, you can display your code online on your web site or blog with great syntax highlighting that matches the language you’re using.

Example:

class Poll < ActiveRecord::Base
    has_many  :poll_answers

    NUM_WEEKLY_QUESTION_ANSWERS = 5

    validates_presence_of :question
    validates_presence_of :go_live_on

    # Return polls that are valid as of "right now"
    def self.current_poll
      # to enable a bit of caching,
      #don't include the seconds in the query
      Poll.last(:conditions => [ "go_live_on <= ?",
          Time.now.strftime("%Y-%m-%d %H:%M:00") ])
    end
end

By including the new CSS in your site instead of pasting it into your page or post, you can take advantage of TextMate’s ability to create only the CSS for your theme. So if you change your blog design and color scheme or your TextMate theme in the future, all you have to do is regenerate the CSS and overwrite the file containing the old theme’s CSS.

textmate-create-theme-css

click to enlarge