15 Sep

GitHub – gimenete/iOS-boilerplate

This project is inspired on HTML5 boilerplate.

  • It is intended to provide a base of code to start with
  • It is not intended to be a freamwork
  • It is intented to be modified and extended by the developer to fit their needs
  • It includes solid third-party libraries if needed to not reinvent the wheel

via GitHub – gimenete/iOS-boilerplate. This looks impressive for anyone building an iOS app.

23 Aug

CSS-Tricks – Functional CSS Tabs Revisited

The idea of "CSS Tabs" has been around for a long time. If you Google it, a lot of what you get is styled CSS tabs, but less stuff on the building an actually functional tabbed area. At least, functional in the sense as we think of tabbed areas today: click a tab, see a new content area with no page refresh.

Tackling functional CSS tabs has less of a deep history. Brad Kemper was messing around with it in 2008 trying to utilize the :checked pseudo selector with radio buttons and adjacent sibling combinators. This is a really cool technique that can be utilized to do things like an expand/contract tree style menu or visually replace form elements with graphics (pioneered by Ryan Seddon).

I personally tried messing with functional tabs a while back, and came up with seven different ways to do it. Most of them centered around the use of the :target pseudo class selector and most of those techniques sucked. One was OK. They all had one major flaw and that was that URL hashes needed to be used, which "jumps" the page down to the element with the matching ID, and that is totally unexpected, jerky, and just a bad overall experience.

Working with the radio-button/:checked technique is way better, but there was a long-standing WebKit bug that prevented pseudo class selectors and adjacent sibling combinators from working together. Good news! That’s fixed as of stable browser releases Safari 5.1 and Chrome 13.

So let’s get this thing done the :checked way, which I think is the cleanest way to do it for now and for the next few years.

via CSS-Tricks – Functional CSS Tabs Revisited. Very nice, pretty decent support if you don’t need to worry much about IE.

28 Jun

Utoxin’s Random Insanity – CakePHP + Symlinks = Pain

Now that I’ve had a day or so to recover, I’m going to tell you about what I just spent 2-3 weeks trying to resolve. By way of explanation, our main product at work is a CakePHP based CMS application. It has a lot of neat features, including the ability for users to upgrade to newer versions any time they choose. We keep all versions present in /etc/precious_core/<version_number>/, and each user has a symlink to the relevant directory in their webroot.

When they upgrade, part of the process is to replace that symlink with a new on that points at their new version. For a long time we’ve known there was a problem of some kind related to CakePHP’s cache that developed after upgrades, but it was never a huge problem, so we mostly just ignored it. However, in a recent release, it started causing major problems, and I got tasked with finding and fixing the actual bug. I figured it would take a day or two, and I’d be done with it. Little did I know just how painful this was going to be.

I initially tried several ways of forcing the cache to get cleared when the app was upgraded. That worked well, as far as it went, but then a new problem surfaced. At least half the time, the cache would re-populate with bad data after an upgrade. Some of the cached file paths would be for the wrong version of the central app, for no apparent reason. I tried throwing even more thorough cache clearing at it. Things got a little better, but it still wasn’t working.

Finally, I fully duplicated our production setup on my local dev machine, parallel version directories included, and installed a PHP debugger, so I could step through the code and figure out what exactly was going on.

via Utoxin’s Random Insanity – CakePHP + Symlinks = Pain. Debugging oh what a joy it is.

28 Jun

GitHub – Linguist

From time to time we get requests asking us to add support for new highlighting lexers, recognize additional extensions as certain languages, or ignore a directory from a repo’s stats graph.

The code for these concerns was scattered around the app. I decided to unify and package them all up into a single library. Now it’s open source.

So if you notice an unrecognized extension or you’re really into some obscure language that isn’t supported yet, now is your chance to help contribute back.

via GitHub – Linguist. Awesome job GitHub, nice to let the community help build out detection for specific languages and frameworks.

06 Mar

Encoded Records – Get your own #dickbar

Inspired by the Twitter iPhone app’s brand new #dickbar, you too can monetize feature Twitter’s trending topics on your website!

Simply insert this Javascript at the end of your page, and you too can see a constant display of #inanehashtags, this week’s terrible movie release, and random jabberings of popular culture that don’t interest you or your users in the least:

via Encoded Records – Get your own #dickbar. For those not in know, the #dickbar is part of a recent update to Twitter’s iPhone app, which displays an annoying bar that lists both promoted tweets and the latest hottest hashtags. The worst part is that it sits on-top of your normal listing of tweets in the app, ie dick-ish move Twitter, very dick-ish. So want to be labeled a dick like Twitter, go right ahead.

23 Feb

najafali.com – Why PHP is better than Ruby

PHP is better than ruby. There, I said it. In this article I’m going to show you why, and probably upset some twenty-something, flip-flop clad, mac-using hippie fanboys in the process.

via najafali.com – Why PHP is better than Ruby. Overall these are very intelligent and reasonable complaints against Ruby.

Update: I didn’t get the sarcasm in the article and yeah it was a pro-Ruby article.

20 Feb

Mathias Bynens – Optimizing the asynchronous Google Analytics snippet

Google has been beta-testing their asynchronous Analytics snippet for a while now. The code has been revised several times already, but still I think it can use some more optimizations.

via Mathias Bynens – Optimizing the asynchronous Google Analytics snippet. This is some micro optimizations but still improvement none the less, however the comments give me some pause on implementing it just yet.