fleshyorgans

Journal of a software engineer with a romantic heart

Code: Dynamically Insert HTML Into Any Rendered PHP Page

So, this pleases me enough to post it. dynamic buffer insertion with PHP Needed to quickly add a notice to every page on a client’s site where there was a single include, but not single-included layout pages (teachers, *sigh*). I’ve never messed with output buffer stuff before, so this was just sort of surprising to [...]

Operator Precedence (ruby et al.)

Thought this was a little silly, but it generated a lot of discussion about precedence, short-circuiting of conditionals, and the value of syntactic sugar. http://pastie.caboo.se/146194

Quick and dirty hack for acts_as_attachment file movement

Say you’re working on something that uses acts_as_attachment. Also say that the person who wrote it decided that all the different models’ attachments would save in the same place. Also suppose that you want to change the file location of all those uploads. Well, here’s a quick and dirty migration that’ll save you from moving [...]

Seriously Word Press, WTH?

While trying to figure out how to remove formatting from ‘wp_list_cats’ in Word Press, I discovered this awesome bit. Click the thumbnail for the full glory of the code. You will notice that in my screenshot, the final function call to ‘list_cats’ at the end is truncated. This is because there are eighteen parameters. Again [...]

PHP and Payflow Pro FOR THE LOSE

Posting this cause I wan’t aware and the only other post I found was dated January. Since Paypal purchased Verisign they are discontinuing the pfpro extension to PHP. And in fact, what I’m reading is that Sept 2009 is the end of life for that functionality, meaning requests will not work beyond that point. For [...]

Vim tip: keyboard shortcuts

Finally got around to learning how to define keyboard shortucts in vim. It’s easy! map <desiredkey> <targetaction> So, for example, I split windows vertically and want to navigate via ctrl+pagedown or pageup. Here’s what I did (include < and > when defining) map <c-pageup> <c-w>h map <c-pagedown> <c-w>l Found via a vim wiki search

Vim awesomeness.

If you use Vim as your text editor, try this :TOhtml This will generate an HTML version of your source code, complete with color scheme. It’s pretty sweet. Example here (opens a new window) This just tickles me.

keep looking »
  • Follow me

  • Twitter

    Powered by Twitter Tools

  • RSS Tumblr Posts