July 29th, 2010

More WordPress Capitalization

Filed under: geek,webdev — saul @ 2:55 AM

If you read THIS article (and possibly used the provided code) you may have found yourself in the same situation I was in tonight - a client WP site with 300 posts each with the titles typed in all caps (what can I say?, THEY, LIKE TO SHOUT) and a handful of pages with titles that included words that actually should be capitalized, we didn’t have an opportunity to discuss as to exactly what kind of words needed to be capitalized - but it turned out that I could just avoid the issue entirely by specifying out capitalization function explicitly - as opposed to filtering all requests for the_title(). So kill off the filter for friendlycae.

Like so (from the template)
friendlycase(get_the_title());

Reality Check

I’m pretty sure at some point in the near future all those capitalize titles will come back to cause pain, but for now (and for launch) this seems to be adequate, but I know it’s only a matter of time.

 

June 24th, 2010

WordPress Smart Capitalization

Filed under: geek,webdev — saul @ 6:06 AM

function friendlycase($title) {
$title = preg_replace( "/(?< =(?<!:|'s)\W)(A|An|And|At|For|In|Of|On|Or|The|To|With)(?=\W)/e", 'strtolower("$1")', ucwords(strtolower($title)));
return $title;
}
add_filter('the_title', 'friendlycase');

Short sweet and it works… so “HELLO SAUL…THIS IS MOTHRA” becomes “Hello Saul…this is Mothra” particularly handy when someone has a tendency to type in all caps. Painfully simple to add your own exclusionary words..

 

April 7th, 2010

The beauty of simplicity

Filed under: daily,geek,mac,webdev — saul @ 7:44 AM

Picture 1.jpgRecently I switched my launcher of choice to ‘Alfred’ a nifty indie project that I became aware of via Twitter, in the past I’ve been both a Quicksilver and LaunchBar user - both extremely powerful apps that although I used them religiously, each had quirks I never could really get past (QS had stability issues, LB was stable but I never wrapped my head around it’s particular method of bringing back results, and it wasn’t going to win any beauty pageants)

Alfred is in beta, but seems stable, visually pretty, and actively developed (which I really appreciate) - And has most of the features you’d want in a launcher - but I want to talk about a single feature, that I really like, Alfred’s use of spotlight comments allows you to create groups of essentially unrelated apps, it’s so simple, so obvious (and honestly it may have worked with LaunchBar too, but I never checked) just add your desired key work to all the apps you want in a group and BOOM! done - I add ‘webd’ to Transmit, Coda, Textmate, Cssedit and Espresso and evoke Alfred and it just works, you can assign as many keywords to an app as you want, for example I add ‘ftp’ to transmit as well.

It’s a simple feature I really appreciate, and we all know how hard simple actually is. So if you’re in the market for a nifty, pretty, deceptively powerful launcher that’s only going to get better - take a look at Alfred.

 

March 26th, 2009

JQUERY SAVES THE DAY AGAIN

Filed under: daily,webdev — saul @ 3:52 PM

The usefulness of JQuery never fails to amaze me - everytime I use it I feel I should be cutting John Resig (and all the JQuery community folks) a check.

John
JQuery

Tagged:

 

March 10th, 2008

Excuse me while I GREP in your face

Filed under: daily,geek,webdev — saul @ 7:11 AM

I don’t hide the fact that I’m a geek, for a designer, I think I hold my own with most webdev programmers - In most regards I know my shit, but until recently I haven’t spent anytime learning regex (regular-expressions) and let me tell you, if you don’t know regex - simply put, you’re working too hard.

Regex is a way to filter strings that match a pattern out of text from a file or from standard input. Regular expressions (or RegExs) can be used with a big choice of programs, most notably grep (the global regular expression parser) and sed (the stream editor).

I know, even the definition is somewhat intimidating, but the power of regex is worth the pain I promise - let’s look at an example, take a look at the following list of fish (assuming that the number was a quantity).

  1. One Fish: 1
  2. Two Fish: 15
  3. Red Fish: 9
  4. Blue Fish: 0

Read More »

 

November 29th, 2007

ICC Profile On By Default?

Filed under: webdev — saul @ 7:20 AM

I want to start by saying that I seldom use Photoshop for web production, I may use it for some visualization and image editing but as a general rule, everything ends up in Fireworks for any layout or slice and dice that may need to happen. Yesterday in what I can only describe as a momentary loss of sanity, I cranked out a few dozen graphics for a promotional blog from Photoshop - all jpegs, all designed to seamlessly fade into the blogs blue background - took me 3 tries - why? - because Adobe in it’s infinite wisdom has ‘include icc profile’ on by default, and I absolutely missed that fact TWICE – if you’re unaware of this setting, it’s a color profile that attempts to assure you get consistent color representation across devices - and it works swimmingly as long as all the software honors ICC profiles - not surprisingly IE and Firefox on a PC don’t, which is why I never use embedded ICC profiles KNOWINGLY. So aggravating..

 

November 27th, 2007

CSS Date Selectors

Filed under: daily,geek,webdev — saul @ 8:50 AM

I recently just finished a project that included a day-by-day itinerary, and an hour-by-hour speakers schedule, I really wanted to highlight the current days events, and emphasis the current speakers bio - not a daunting task by any means - but always looking to skin the cat differently, I used a single line of php, and a two generated css selectors.

here’s an item from the event list

&lt;ol id=&quot;3070812&quot;&gt;
&lt;li&gt;Effective Sales via email&lt;/li&gt;
&lt;li&gt;Time: 12pm&lt;/li&gt;
&lt;li&gt;Date: March 7th, 2008&lt;/li&gt;
&lt;li&gt;Location: Green Room Loungue&lt;/li&gt;
&lt;/ol&gt;

Read More »

 

July 19th, 2007

Useful WebDev Links

Filed under: daily,webdev — saul @ 8:50 AM

I was just cleaning up a few bookmark bar folders, and I thought these might prove useful for someone - I’ll assume you know what a bookmarklet is. Also I did not write any of these bookmarklets (I simple gathered them), I use them, find them endlessly useful and am storing them here purely as a convenience - I offer no warranty as to how helpful YOU may find these items.

MISC

CSS

CSS/WEBDEV BOOKMARKLETS

XML

RESIZE BOOKMARKLETS

WIZARDS/GENERATORS

BACKGROUNDS

GRAPHICS