Fork me on GitHub

home

New WP Salts command in the WordPress TextMate bundle

September 14, 2011 | TextMate, WordPress | 1 comment

I just merged a pull request from Simon Wheatley in to the WordPress TextMate Bundle that adds the command wpsalts to generate the Security Keys for the WP Config file. The command uses the WordPress.org secret-key Service.

Very handy.

Thanks Simon!

Fog

September 3, 2011 | Photography | No comments

Mt. Davidson moody fog

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.

curl’ing a URL in TextMate

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.

  1.  #!/usr/bin/env ruby -wKU
  2.  require ENV['TM_SUPPORT_PATH'] + '/lib/io.rb'
  3.  require ENV['TM_SUPPORT_PATH'] + '/lib/current_word'
  4.  require 'open3'
  5.  require 'cgi'
  6.  theUri = Word.current_word('a-zA-Z0-9#\-_\.:;%/?&=@!$^\*\+', :both)
  7.  if theUri.include? '@'
  8.   auth, uri = theUri.split('@')
  9.   theCommand = "curl -s -u #{auth} \"#{uri}\""
  10.  else
  11.   theCommand = "curl -s \"#{theUri}\""
  12.  end
  13.  stdin, stdout, stderr = Open3.popen3(theCommand)
  14.  TextMate::IO.exhaust(:out => stdout, :err => stderr) do |data|
  15.   puts data.rstrip
  16.  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!

A day at the beach

August 6, 2011 | Dogs, Life | No comments

Couple of weenies

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.

Beach Steps Gun Fortification @ Fort Funston Bear & Dozer enjoying the beach Chasing each other, as usual Romping on the Beach

WordPress TextMate bundle updated for WordPress 3.2

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.

New and Improved Function Definitions

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!