September 3, 2011 | Photography | No comments
I think this is just the first in a long line of foggy photos… We live in “Sunnyside” but that’s the misnomer of the century. We see the sun here about every 5th or 6th day.
August 18, 2011 | TextMate | 1 comment
Ok, sorry, I can’t let all the BBEdit users think that they’ve discovered something new
In case you’ve noticed the amazement lately on blogs and twitter where BBEdit users have discovered a way to open a curl’d url in BBEdit to view its source you may be wondering “how do I do this in TextMate”?
Well, its a little more code, but its also a little more powerful.
-
- require ENV['TM_SUPPORT_PATH'] + '/lib/io.rb'
- require ENV['TM_SUPPORT_PATH'] + '/lib/current_word'
- require 'open3'
- require 'cgi'
- theUri = Word.current_word('a-zA-Z0-9#\-_\.:;%/?&=@!$^\*\+', :both)
- if theUri.include? '@'
- auth, uri = theUri.split('@')
- theCommand = "curl -s -u #{auth} \"#{uri}\""
- else
- theCommand = "curl -s \"#{theUri}\""
- end
- stdin, stdout, stderr = Open3.popen3(theCommand)
- TextMate::IO.exhaust(:out => stdout, :err => stderr) do |data|
- puts data.rstrip
- end
So, add this as a command in your bundle and tell it to open a new document when its done. Assign it to a keyboard command (if you haven’t already assigned other items to every other keyboard combination under the sun like I have). From here you can simply highlight a URL in a document, trigger the command, and get the source of the url in a new document.
On top of that, if the url contains credentials a-la “user:password@http://foo.com” it’ll use the “user:password” portion to authenticate you against simple Apache 401 authentication.
I’ve been thinking that it would be nice to have this also check the clipboard if there’s nothing selected. But I haven’t gotten around to trying that yet.
This and a few more helpful commands can be found in my General TextMate Bundle on Github (also available through GetBundles).
Enjoy!
August 6, 2011 | Dogs, Life | No comments

The boys got their first taste of the beach at Fort Funston today. Literally a taste. They made themselves sick drinking the sea water. Hopefully they learned their lesson.
Yeah, probably not.
July 11, 2011 | PHP Scripting, TextMate, WordPress | 1 comment
So, WordPress 3.2 has been out for a little while now and I’ve just gotten around to updating the bundle. My apologies, I’ve just been super swamped with a new job in a new city. But that’s some whining for another post.
After much fiddling, the updated WordPress TextMate Bundle is here and it has been updated with a much better function definition display. I’ve ditched the old function scraper that was an abomination of grep & regex matches and replaced it with doxygen and some ruby abomination to provide much more information about the function or method being inspected.

I’m pretty sure there’s a lingering issue with the parsing and display of special characters in the doxygen output (which I blame squarely on strange handling by doxygen) that I haven’t handled yet. There may be HTML Entities missing from the documentation here and there.
Also improved is that the function definition search is contextually sensitive. It’ll only look for methods when in object scope (ie: $object->method();) and only look for functions when in regular php scope (ie: function();). There’s also a prompt to select the method that you’re actually after when multiple matches are found.
So, as always there’s something that can be improved upon with the bundle, but its moving forward and getting better with each revision. I guess that’s something, right? RIGHT?
So, fire up GetBundles or head on over to the WordPress TextMate Bundle’s Github Page to update your bundle!