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.

 

July 13th, 2010

More iTunes Remote Fun

Filed under: daily,geek,mac — saul @ 8:13 AM

Search your remote Library and create a playlist based on your search - and of course play your playlist, knowledge gleaned from Doug and Rory

-- you'll want to set this line to reflect your remote machine info
set remoteMachine to "eppc://username:password@machinename.local"
set keyword to "Gogol Bordello"
display dialog "Search:" default answer keyword
set vol to text returned of the result
using terms from application "iTunes"
	tell application "iTunes" of machine remoteMachine
		set my_search_results to (search library playlist 1 for keyword)
		if my_search_results is not {} then
			set myList to make new playlist with properties {name:keyword}
			set sel to a reference to my_search_results
			repeat with aTrack in sel
				set thisTrack to (get location of aTrack)
				set dbid to (get database ID of aTrack)
				add thisTrack to myList
			end repeat
			set currentList to playlist keyword
			play the playlist named keyword
			reveal current track
		end if
	end tell
end using terms from

Two obvious TODO’s in my code - it doesn’t do muchANY error checking so although iTunes does seemed to care if you have multiple playlists sharing a name (meaning it doesn’t overwrite them) THAT might not be what you’re intention. I’ll probably be fixing that at a later date. Lastly it doesn’t offer any feedback - which I suppose is fine, but not very me so I’ll probably add some GROWL notification in regards to if the playlist was created and how many tracks were added.

Again really just scratching the surface here, and Doug & Rory did all the heavy lifting on this one.

 

July 12th, 2010

Alfred, To The Bat Cave…

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

alfred Alfred, To The Bat Cave...I’ve blogged about Alfred once before, it’s a great little launcher - the fact that it uses Spotlight comments to tag/exclude/group apps and files for launching is IMHO it’s killer feature - being able to group all your tools AND files/documents together makes Alfred a awesome workflow tool, but I’m not here to talk about work, well not exactly - take a look at the pic at the top of this post - 6 small apps (whose code I gleaned from here), each app controls playback and volume of my Jukebox G4 Laptop, all linked together with the spotlight keyword ‘JUKE’ those combined with GROWL makes for a really powerful combination, I can control every aspect of playback of the jukebox - and get feedback as to what’s currently playing without ever taking my hands off the keyboard. I wasn’t able to find that exact Functionality anywhere else, and because I run Alfred and Growl anyway there’s ZERO OVERHEAD.

This only really scratches the surface of what’s doable, so stayed tuned. At some point in the future I’m sure Alfred will allow us to pass arguments to scripts (ala Launchbar) at that point I’ll write scripts that Spotlight tags selected files into Alfred groups, and the universe will recursively collapse upon itself.

(Icons by David Lanham)

 

July 11th, 2010

Simple Mac m3u Playlists

Filed under: daily,geek — saul @ 8:30 AM

I recently started to explore other mac media players, iTunes has awesome functionality, but sadly it’s a pig memorywise, so my day to day music listening software has become VOX whose small footprint and clean UI hits all the right notes for me. I needed a simple way to create m3u playlist files (which are really just filelists saved with a ‘m3u’ file extension - every solution I could fine seemed overkill, most of the Automator workflows I found were predicated on you already having a iTunes playlist you wanted to export - I wanted just a clean ‘right/control click on folder full of music - ‘save as playlist’ kind of functionality.

Attached is such a workflow. I’ve used it successfully recursively on a folders containing 10,000 songs, and (although Automator takes a few seconds to actually startup) the action it self is pretty fast.

A few notes:

  • It attempts to filters out the kind of CRUFT (.txt,.jpg,.png,.nfo) that you might have in a folder if you <cough>[acquire]</cough> music via some type of distribution network.
  • It asks you what you want to name it, but by default it’s going to save it to your desktop.
  • it includes subfolders as playlist items, VOX ignores these so I didn’t bother to exclude them - I suppose other players might actually choke on them so YMMV.
  • The attached file is the full-fat editable automator workflow - you’ll probably want to save that as a finder plugin

I haven’t had any issues with it, let me know if you find it helpful.

DOWNLOAD: Create_M3U_Playlist.workflow

 

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.

 

February 4th, 2010

CodeEquivalenceDatabase

Filed under: geek,mac — saul @ 6:55 AM

For the past 6 months I’ve had this interesting mac issue - once or twice a month my internal drive which generally has about 90GB free on it would drop to 25GB free or less, I originally thought perhaps the drive was dying because rebooting off a system dvd and repairing the drive generally fixed it - about a week ago - that fix stopped working, and I thought hmm.. maybe something just isn’t cleaning up after itself - since we’re talking about 65GB I immediately thought it must be iPhoto/Photoshop/Illustrator/Fireworks since it’s pretty unlikely coda/textmate/expresso (and YES I use all three) ever use that much of anything - so I dug deeper, I have a demo of DaisyDisk hanging around that showed me my ‘CodeEquivalenceDatabase’ (which lives in: var/db) file was 64GB - it didn’t take a rocket scientist to figure out that it was likely that file was the problem - but I wasn’t sure, maybe that file was supposed to be that big - some more googling and that file is tied directly to 1password and keychain - I ran repair ‘keychain’ BOOM crashed/reboot/won’t restart/lovely - reboot again and it came back - some more googling led me to believe I could just delete ‘CodeEquivalenceDatabase’ and it would be regenerated, so I did - and it was, the new file was 16k UNTIL I launched Transmit, it seems that every time I launch Transmit the file doubles in size - I suppose that might shed some light on how often I launch Transmit (I’d love for someone to do that math).

Conclusion

I deleted Transmit and reinstalled, and the problem seems to have gone away, it’s important to mention that it’s highly unlikely this was a Transmit problem, it more likely that it was just a very ugly anomaly on my machine, I haven’t experienced anything like this on any other system.

 

April 19th, 2008

Merch Available

Filed under: daily,geek,rant — saul @ 4:37 AM

and I died a littleEvery good story need some pictures, this story was about a whirlwind service experience with America’s largest cable company…the girl?, we don’t know for sure, we call her ‘Julie’, say hello to Julie… because I couldn’t figure out how to sell the shirts at cost, I will be donated proceeds to ‘Hope for the Animals’ a no-kill animal shelter in Langhorne, PA. Buy merch here.

Tagged:

 

April 16th, 2008

Comcast connection woes

Filed under: daily,geek,rant — saul @ 8:07 AM

So stop me if you’ve heard this one before, Everynight at 5:45 — 6:30 my Comcast Broadband internet connection drops, it doesn’t just drop a little, it doesn’t just drop now and then – it drops to 0kbps [I suppose it doesn’t matter what unit of measure I use to communicate zero does it], it drops everyday - after a handful of laughable calls to tech support [unplug modem, reset router, die a little more inside] and troubleshooting on my own I’m fairly certain the issue is twofold:

  1. The splitter in my backyard is dead/dying, this isn’t a difficult assumption because it’s been replaced 6 times in 2 years [more on this later]
  2. The added traffic/strain of everyone on my block surfing online, talking on the phone and
    watching TV diminishes my already splittered-weakened signal to a whisper

Reach out and tweet someone

I’ve been twittering with a gentleman named frank [@comcastcares] who works for customer relations for Comcast, he has a thankless job - he’s basically doing damage control to the twittering community - but the interesting side effect of following frank on twitter is that I can read the issues everyone else is having - and my issue is fairly typical, lots of folks with a near identical problem. That being the case, you would think Comcast would have some type of handle on the issue, or at the very least their techs would acknowledge it.

IMHO if Comcast would public admit they have a problem would be an excellent first step, but to help them along I may print a few 1000 [unplug modem, reset router, die a little more inside] t-shirts, let me know what size you need.

My Spin on the Underlying problem

This is purely conjecture, but 800lb Gorilla Comcast has been pushing their ‘triple pack’ very hard in the northeast, it’s success is putting additional strain on their network, and that strain is exposing flaws in the coaxial/splitter networking that’s been in most of their customers homes for 15 years - how do they react, they announce a ‘wiring protection plan’ only $3.95 a month - and pimp it heavy on every tech call - lovely, aren’t I already paying for service I’m not getting? Wasn’t it your technicians who originally wired this crap originally? Isn’t my/our continued patronage worth 50 feet of coaxial and a two dollar splitter? Needless to say, Hearing service plan offers when I’m not getting service is not an effective sales technique, at least on me.

Possible Solutions

Obviously the first thing that comes to mind as a solution is switch providers, FIOS is readily available in my area, and the pricing even without bundles is fairly competitive. I could just go to Radio Shack and buy myself a handful of splitters, and replace them one by one as needed, Honestly they are $1.49 this is costing me 1000 times that in lost productivity and found aggravation.

I think it’s significant to mention that I have chosen to use what little bandwidth I currently have to write this post, so are you having issues with Comcast and your broadband connection? let me hear about it.

Update here

Tagged:

 

April 3rd, 2008

A Brand New WordPress

Filed under: daily,geek — saul @ 1:18 AM

So courtesy of the auto update plugin - I have a brand new wordpress (really it feel’s like that) - I must say that aside from a few things (most notably the location of the categories list in Publish) I like it, and that the boys and girls at Happy Cog did an admirable job on the facelift.

 
Next Page »