Thursday, December 15, 2016

Approximating GNU parted in Windows

I partition disks in Linux all the time. But, thanks to disk ghosting, I don't do much partitioning in Windows. When I do need to partition in Windows (like external drives), what do I use? Enter the...

Thursday, December 8, 2016

Wednesday, November 30, 2016

Friday, November 11, 2016

Bypassing private and protected visibility in PHP

Members declared protected can be accessed only within the class itself and by inherited classes. Members declared as private may only be accessed by the class that defines the member. PHP documentation on property visibility This is true only in an academic sense: code outside the object can...

Wednesday, March 23, 2016

The end of the mouse era

Doug Englebart invented the computer mouse nearly 50 years ago. Before HD, before GPU, before UX, the mouse let people interact with an information rich virtual space with ease. The generation whose work productivity preceded the mouse are retiring. Today's work force learned young or grew up...

Thursday, March 3, 2016

Evoking all possible test failure modes in PHPUnit

When you're writing your own PHPUnit test listener, you need a test case that evokes all the different PHPUnit test states. Here's you go: <?php class EvokesTest extends \PHPUnit_Framework_TestCase { public function test_pass() { } public function test_fail() { $this->fail(__FUNCTION__); ...

Thursday, February 25, 2016

Disabling Plugins in Jenkins

If a plugin upgrade causes problems, Jenkins may not restart. You'll be welcomed by an error message and a stack trace. Don't panic! Go into your Jenkins plugin directory, list files by date, and then disable the most recent ones: $ cd $JENKINS_HOME/plugins $ ls -ltr *.jpi -rw-r--r--. 1 root root ...

Thursday, February 18, 2016

Big list of files to edit? vim to the rescue (again)

Did you know that you can treat the text under the cursor as a filename, and open that up for editing right in vim? Here's how: gf will open the filename under the cursor in the current window ^Wf will open it in a split window ^Wgf will open it in a new wind...

Thursday, February 11, 2016

Today's fortune

Let us not look back in anger or forward in fear, but around us in awareness. — James Thurbe...

Thursday, February 4, 2016

Private methods are collaborators in disguise

Private methods cannot be unit tested, only integration tested through whatever public methods call them. I find this unsettling. I want to unit test private methods, so that I know the public methods are composed of independently verified code. What to do? My first tactic is to avoid private methods....

Thursday, January 28, 2016

Vim gem: built-in calculation

Vim is my go-to editor. Has been for 20 years. Besides being an all-around awesome editor for composing text, it also has some handy built-ins, like calculations: In insert mode, ^R= accepts a mathematical expression, the result of which will be inserted in place. In normal mode, ^A increments the...

Thursday, January 21, 2016

Thursday, January 14, 2016

Monday, January 11, 2016

[Proposed] Elephpant Etiquette

Yes, I do believe PHP internals needs a guide to etiquette. But, no, not a code of conduct. Internals is a decades (plural) old cathedral-like meritocracy. There is no benevolent dictator. There is no functional oversight group. No rigorous process (like Go has) will work in the internals ecosystem. Anthony's...

Friday, January 8, 2016

PHP Contributor Etiquette

I was the first to publically +1 the Code of Conduct RFC. I'd love to see a policy that fosters diversity and inclusion, because damn the PHP crowd is startlingly similar. But, after hearing the arguments, I can't endorse the code as written. It's too focused on process and punishment....