fleshyorgans

tryin’ not to be a linux fanboy

fleshyorgans Two Cats

Code: Dynamically Insert HTML Into Any Rendered PHP Page

February 15th, 2008 · No Comments

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 me. It’s […]

[Read more →]

Tags: stuff

Operator Precedence (ruby et al.)

February 1st, 2008 · No Comments

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

[Read more →]

Tags: stuff

Quick and dirty hack for acts_as_attachment file movement

December 10th, 2007 · No Comments

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 files […]

[Read more →]

Tags: programming · stuff

Vim awesomeness.

September 28th, 2007 · No Comments

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.

[Read more →]

Tags: programming · stuff · vim

My tools for development under Ubuntu

August 29th, 2007 · No Comments

My work machine recently developed the click of death, so I had to get a new hard drive and reinstall everything. Just in case this happens again, and in case anyone else is interested, below is the list of things I install in addition to the standard Ubuntu installation:

[Read more →]

Tags: stuff