
Category: Blog Posts
-

In Praise of Property Design
This week Mad Horse Theatre is opening Alligator Road, a brand new play by Callie Kimball. In the play, the main character has lost her husband and inherited his hardware store. She covers every item in the store with hand-knitted cozies. Why, you ask?
You’ll just have to see the play.
Megan Tripaldi designed the props and the set dressings. She worked with a clan of knitters to essentially yarn bomb a hardware store. For those of you who know her, and how much she loves knitting and theatre, it will come as know surprise that this was a dream gig. She nailed it!
I got a look at the set tonight, and I was delighted by all the tiny details. I tip my hat to Megan and to Chris Sullivan who designed and constructed the set. I didn’t get to see the show because they were sold out. Get your tickets while they last.
-

Diacritical typing with Mac OS
Meet me at the café for jalapeño poppers. Then we’ll catch an Über to my château and I’ll read you my résumé. It was too easy to type that. It is always a happy moment when I discover something new on my mac.
Today I learned a new word: A diacritic is a mark that is added to a letter. The symbolic meaning of a diacritic varies from language to language. We see them most commonly in English words we’ve borrowed from the Romance languages. Apple has made it easy to work them into your typing. Simply hold down a key (usually a vowel) and select the number of the diacritical mark you desire.

-

Using back-ticks with Slack mobile
There are plenty of articles on hidden tricks in Apple’s operating system. Apple even has an app for that. Still, it is always a happy moment when I discover something new on my own.
Today I learned how to add back-ticks while entering text. Why would you need back-ticks? Because that’s how you style your text as computer code. Just hold down the apostrophe key, and you’ll get an option to enter a back-tick. It is very handy for sharing code on the go via the Slack app.

-

Fun with WooCommerce
One of my first big achievements as a software engineer was creating an e-commerce platform from scratch. It was only ever used on my clients’ sites, but it was pretty handy, helping small budding businesses process thousands of orders. It is still in use on a few sites today.
I recently helped a friend switch their site over to WordPress. Their old site was running my aging e-commerce system, so I assisted them in upgrading to WooCommerce. I found the experience to be quick and painless. Woo was everything I could ask for in an e-commerce platform: it’s free version has everything a small shop could ask for, and paid extensions are available if you need get more complex. My friend was able to get by with just the free version.
As a developer, I found Woo very flexible. In just 2 hours, I was able to write a script that ported the past orders archived on my system into Woo. Here is a basic abstraction of how to programmatically add orders to Woo. Hope it helps if you ever need to do something similar.
set_orders(); // This assumes that all of your archived orders were processed with paypal, // and that you've already entered your paypal settings in the WordPress admin area. $this->gateway = new WC_Gateway_Paypal(); foreach ( $this->orders as $order ) { // This will generate a new WC_Order object which is a custom post type of shop_order. // Sets the status to completed, because I assume if you are importing orders into Woo // the orders have already been processed. $args = array( 'status' => 'completed', ); $woo_order = wc_create_order( $args ); // A new WC_Order's date defaults to the current time. // Let's adjust it to the purchase date of your archived order. $this->set_date( $order->payment_date, $woo_order ); // Adds billing / shipping address to the order $this->add_customer( $order, $woo_order ); $this->add_items( $order, $woo_order ); $num ++; } echo ''; echo "$num orders created"; echo "n"; print_r( $this->new_orders ); echo '‘;
exit;
}public function set_orders() {
/**
* Populate $this->orders with orders from your old system.
* Ideally, $this->orders should be an array of objects where
* each object contains all possible info about a past order.
*/
}/**
* Sets the date of the new woo order to the old order’s purchase date
*
* @param $orginal_date – the original date of purchase in some human readable format
* @param $woo_order – the WC_Order object
*/
public function set_date( $orginal_date, $woo_order ) {
$args = array(
‘ID’ => $woo_order->id,
‘post_date’ => date( ‘Y-m-d H:i:s’, strtotime( $orginal_date ) ),
‘post_date_gmt’ => gmdate( ‘Y-m-d H:i:s’, strtotime( $orginal_date ) ),
);
wp_update_post( $args );
}/**
* Adds billing and shipping information from the old order to the woo order.
*
* @param $old_order
* @param $woo_order
*/
public function add_customer( $old_order, $woo_order ) {
$woo_order->set_payment_method( $this->gateway );
// The keys in this array are how woo formats an address.
// The values can be formed to your old systems specs.
// All keys are required. Leave value blank if not using.
$address = array(
‘country’ => $old_order->address_country,
‘first_name’ => $old_order->first_name,
‘last_name’ => $old_order->last_name,
‘company’ => $old_order->address_company,
‘address_1’ => $old_order->address_1,
‘address_2’ => $old_order->address_2,
‘city’ => $old_order->address_city,
‘state’ => $old_order->address_state,
‘postcode’ => $old_order->address_zip,
’email’ => $old_order->payer_email,
‘phone’ => $old_order->payer_phone,
);
// Assumes that the billing and shipping addresses were identical
$woo_order->set_address( $address ); // defaults to billing
$woo_order->set_address( $address, ‘shipping’ );
}public function add_items( $old_order, $woo_order ) {
// loop through every item in the old order and add them to the new woo order.
foreach ( $old_order->items as $item ) {
// This assumes you’ve already imported or added products to Woo.
// This also assumes your old products use some sort of variation logic ( like ‘size’ or ‘color’ ).
// You could also use a different object such as WC_Product_Simple
// What ever type of product you use, you’ll need to write some logic that maps your old product to a woo product
$woo_variation_id = $this->map_product( $item );
$product = new WC_Product_Variation( $woo_variation_id );
$quantity = $item->quantity;$args = array(
‘totals’ => array(
‘subtotal’ => $item->price,
‘total’ => $item->price * $quantity,
),
// assumes you’ve already configured your product attributes / variations
// in this example we have size and color, like a t-shirt
‘variation’ => array(
‘pa_color’ => $item->color,
‘pa_size’ => $item->size,
),
);$woo_order->add_product( $product, $quantity, $args );
}// Adds a flat rate shipping line item to the order.
// Assumes you’ve already configured your woo shipping settings.
// You could get more complex if you need to.
$shipping_rate_id = ‘wc_shipping_flat_rate’;
$shipping_rate_label = ‘Flat Rate’;
$shipping_rate_cost = $old_order->shipping;
$shipping_rate_tax = 0;
$shipping_rate_method_id = false;
$shipping_rate = new WC_Shipping_Rate( $shipping_rate_id, $shipping_rate_label, $shipping_rate_cost, $shipping_rate_tax, $shipping_rate_method_id );
$woo_order->add_shipping( $shipping_rate );// All of these totals are required, set them to ‘0’ if you don’t plan to use them
$woo_order->set_total( $old_order->tax, ‘tax’ );
$woo_order->set_total( $old_order->payment_total );
$woo_order->set_total( $old_order->shipping, ‘shipping’ );
$woo_order->set_total( ‘0’, ‘shipping_tax’ );
// This will allow the imported sales to show up in reports
$woo_order->record_product_sales();}
/**
* @param $product – information about a product from your old system
*
* @return int – should return a woo product id or a woo variation id
*/
public function map_product( $product ) {
// run logic to map your old product to a woo product
return 1;
}
} -

3 things to do in Pittsburgh if you only have 2 days
- Visit your cousin Jennifer who is studying to be an engineer at the University of Pittsburgh. The university section of Pittsburgh (Oakland) is interesting. It is secluded away from the downtown area. It is quiet and pleasant. It is even nicer if your cousin Jennifer gives you a walking tour through the choicest locations, such as…
- The Cathedral of Learning: Oakland is not like downtown. There are no skyscrapers, except for one, giant, ominous tower know as the Cathedral of Learning, or Cathy, to locals. It looks like Hogwarts inside. It houses many working classrooms, including these recreations of schoolrooms from around the world.
- Visit the Andy Warhol Museum. He created much more than soup cans.
-

Zen Pencils
I was thrilled to discover Zen Pencils, a site where cartoon artists add imagery to famous quotations. Also thrilling? The site was built in WordPress! Here are a few good ones:
- Steve Jobs: “Your time is limited…”
- Douglas Adams: “A good time to be alive…”
- Kevin Smith: “It costs nothing…”
- Amelia Earhart: “Fears are paper tigers…”
I do have one small criticism on the site’s user interface. The navigation between comic strips is most prominently controlled by a drop down. It is awkward. At the very least, the current comic should be pre-selected. Maybe the navigation needs to be re-thought completely. Can I fix that for you?
-
Transcendent Songs
Tell me of a song that can make you weep openly in a coffee shop.
Those who know me know that I like hippy music. For everyone else I’ll out myself now: hippy.
Today, while in a public cafeteria, I started crying while listening to Phish cover the Grateful Dead’s Terrapin Station. 🙂
There are many reasons I wept. This has been a long time favorite song of mine. From the first time I heard it in 1996 until this day, this song has consistently moved me. It is the perfect poetic and musical metaphor for life. Also there is the context of this particular rendering: it was sung to eulogize its author, Jerry Garcia, 3 years after his passing. And of course I wept for Harris, the reason I was listening to the song in the first place. Harris Whittles, who passed away recently, ran a podcast called Analyze Phish, in which he tried to get fellow comedian Scott Auckerman to become a fan of Phish’s music. Hilarity ensues.
Is there a song you can think of that would make you cry while you are driving, or working, or sitting in a coffee shop?
-

Westbrook Office or “The Mill”
Here is a photo of the signs for our new Maine office crafted by Tinkering Monkey, and a photo of the office, AKA “The Mill”, at dusk. Though the wind chill probably has us below zero, things are looking hot in Westbrook.
-

Wintery Willard Beach
So I wasn’t able to go skiing this weekend, but fortunately I found a way to shake off the blues.
Megan and I went to Willard Beach, and though the sun was shining, the wind chill was slightly frigid. Despite the chills we had an excellent time. As you’ll see from the pics below, a beach in Maine is beautiful no matter the season. Don’t wait for summah, bub, go now!
Our intention was, of course, shameless self-promotion, or SSP as we say in show business. Megan, as you might know, is an actress, and every few months she needs to shed her current batch of headshots, and shoot a new set. We hoped to score some nice 8×10 beauties today, but it was too sunny, breezy, and chilly to set up an outdoor portrait studio. As the saying goes, “We’ll get ’em next time”. At the very least, we were able to go on a brisk walk and breath the salty, Maine air.
-
Move your body
It has been a tough winter here in the New England, and seasonal depression has been problematic. I know I need to go skiing, or something. This video is always a sure ticket to make me want to move!
-
New development patterns
I spent about 2 years developing plugins in the WordPress wilderness. In that time I became proficient in plugin architecture, in how to structure and organize your plugin so that it is optimized for scaling and maintenance. As I enter my sixth month working for Automattic, my fascination with coding architecture and patterns becomes deeper.
One thing is clear: to thrive as a software engineer, it is of course essential to be fluent in many coding languages, but one must also be a connoisseur of application architecture. On a daily basis we work behind the scenes to create non-tangible architecture. And to me, it is most satisfying to see visualizations and hear descriptions of our work that gives our digital citadels a semblance of tactility.
This week, at the behest of some co-workers, I watched a few great presentations on react.js, a newly-released javascript framework from the folks at Facebook. I want to re-share those videos here as a reminder of how much has changed since I was strictly a plugin developer. Change is good. It is never good to get too comfortable as a developer. We are always looking for better ways to write code-poetry and build Fallingwater web apps.
-

Roadtrip to Morgantown
After driving through the quaint seaside towns of Connecticut, the chaos of New York and New Jersey, the endless rolling farmlands of southern Pennsylvania, and the twisting mountains of West Virginia we arrive in Morgantown. And just in time to celebrate burrito Friday at Black Bear Burritos, then quickly walk through the wintery mix to the MT Pockets Theatre Company. We are here for their annual one act play festival, which features productions written by playwrights from around the country. Megan’s play, Hit Person, was one in ten chosen from a pool of over 300 submissions.
I am overdressed. My three piece suit, which I put on to express pride in my wife’s accomplishment, is too much for the casual, friendly atmosphere of the MT Pockets. Everyone knows each other; some of them have worked together to build this event. Just as I start to wish that I was wearing my standard jeans and hoodie, Toni Morris, the creative director gives us a warm welcome. She is expecting us. Our 10 hour drive earns us VIP treatment to match my unusual attire: waived admission, and reserved front-row seats.
The show starts, and we experience 10 well written plays, some of them funny, some sad, some of them frenetic, some quiet. All of them are beautifully acted, and creatively directed to make use of limited resources. Megan holds my hand while her play is staged, nervous at the first time seeing her words come to life. She is close to tears (of joy) when the lights go down.
We meet the cast after the curtain call. They are all impressed that we drove so far, they recommend some good eateries in Morgantown, and they admit that they were more than nervous performing for the playwright in the front row. Though we are starting to get sleepy, we have enough energy to keep the conversation going for a bit. We learn that Missy Ryan, who portrayed Nichols in Hit Person, is a profession clown. She hopes to travel to schools and use her character Miss Pockets to educate students about pressing issues. And Bobby Wolfe, who portrayed Spencer, was recently in Out of the Furnace and he shared stories about working with Woody Harrelson and meeting Willem Dafoe. We leave the theatre exhausted and elated.
-

2014 Time Lapse
Holy smokes, 2014 was the biggest year of my life thus far! When I try to convey the magnitude of this year to my friends and family in everyday conversation, my emotions win out, and I trail off. So why not put all of the events in a nice easy-to-consume list, in chronological order for those of you who have not yet broken the barriers of time.
I marvel at how much Megan and I compacted into this year. I often complain that I don’t have enough time. After living through 2014, I realize that I should stop complaining, that my lifestyle is not so delicate, that there is always a way to squeeze in more life, that my body can take it.
Commence the time lapse:
March 8th: My beloved cousin Johnny dies. He meant so much to so many. I’m still denying that he’s gone as I write this, and I will be feeling the reverberations of his death for years to come, if not the rest of my life. I wrote a letter to his daughter to help me cope.
March 30th: We learn that Megan’s dad, whom I refer to as Papa John, has cancer in his urinary bladder. We visit him, and the prognosis is bittersweet: It is likely curable, and the treatments aren’t as harsh as chemotherapy, but there’s a considerable chance he could loose his bladder resulting in a large drop in the quality of life. We’ll wait and see…
April 6th: The newly assembled BruteProtect team has its first official meet-up in Albuquerque, NM. My employer, The Hotchkiss Consulting Group, switches from being a web design agency to a start-up overnight! Sam Hotchkiss put together an awesome team who has since become my second family. Our aim at this point is to create a robust WordPress plugin that allows folks to secure their websites, as well as manage multiple WordPress websites from one dashboard. We work hard and play hard for seven days in beautiful Albuquerque, sweating green chile from every pore, and battling gnarly server scaling problems. It was an amazing bonding experience, and if you want to know understand it better, watch Silicon Valley on HBO – it was basically written about us.
Late April: After thousands of hours of work, we launch My BruteProtect, a premium version of our plugin. We will spend many more hours in the coming months adding features, fixing bugs, and providing customer support.
May 5: Megan and I take our belated honeymoon to Edinburgh and London. We get some much needed relaxation, and fall in love with both cities immediately, as well as with each other all over again. The trip includes haggis, hiking, and whisky in Scotland, and lots of great theatre in London.
Summer: Megan performs in 4 plays in the exciting PortFringe Theatre Festival. This is followed by a warm performance in The Selfish Shellfish at Deertrees Theatre. Her original play, Open Casket, gets produced at the Footlights Theatre.
August: This is the month of WordCamps. I travel to WordCamp New York with Sam Hotchkiss and Derek Smart, and my dream of one day opening my Rocco’s Tacos restaurant is shattered. There was a Rocco’s Tacos right next to our hotel, and they’re a chain, and they weren’t open so I couldn’t even try a taco and tell them how mediocre they were! The next week, the BruteProtect crew assembles for the first ever WordCamp Maine, an event organized largely by our own Stephen Quirk. The next week, most of the team heads to WordCamp Boston.
August 28th: BruteProtect is acquired by Automattic. Our goal was always acquisition, but none of us ever dreamed it would happen so quickly. We joined the company just in time to fly out to the annual Grand Meet-up, held this year in Park City, Utah.
September 27: I speak at my first WordCamp. I talk about using a MVC mindset when developing WordPress plugins.
October: Megan and I help out our friend Cory King by performing in his yearly Haunted Hayride in Skowhegan Maine. I think our costumes are effectively creepy, yes?
November 6: I returned to the stage after a 7 year hiatus. I play the part of the Earl of Kent in my wife’s adaptation of Shakespeare’s King Lear at the Footlights Theatre. It was my first time locking wits with The Bard, and it was very challenging. I was still refining my performance with each night’s show, and by closing night, I nailed it! I also designed the blood effects. So much blood.
November 13: I give a lecture at St. Joeseph’s College in Windham, ME talking about what is like to persue a career on the internet. Thanks to my pal professor Chris Sullivan for inviting me.
The Holidays: Papa John’s cancer goes into remission! We spend a lovely, relaxing Thanksgiving and Christmas with him.
-

Happy Birthday Beth Chasse
On stage, or in real life Beth Chasse will intoxicate you. She is an amazing actress, writer, and an essential force in Southern Maine’s theatre community. A pack of wildlings, including her main squeeze Cory King, and her lovely mom Twila celebrated her birthday in epic fashion last night. Though Pedro did not make an appearance, a song was sung in his honor.
We started the night at Salvage BBQ in Portland for top notch Barbecue and creative cocktails. If you’ve not tried it yet, go. Beth opened a gift from Cory that elevated the tone of the evening to a sassy roar.
We moved on to the Snug, which may be the best venue for the spirited, ribald conversation that this group often produces. Thanks everyone for a great night. I’ve collected some highlights from various social media below.
-

Thanksgiving 2014
We drove into Fitchburg, MA the night before Thanksgiving. We departed from Portland, ME at around 10 am and made our first stop in Boston. We had about 2 hours to kill before meeting up with the mommy side of Megan’s family at her grandmother’s home in Chestnut Hill. We decided to try to find the Garment District in Cambridge, and our goal was to find it without using GPS. I’m proud to say that it was a team effort, and that we found the shop after about a half hour. :highfive:
The Garment District is amazing. There is always a great find to be found. Megan found some green Doc Martin boots, and I found a nice coat that I fell in love with. I ended up not buying it because I’m not really a leather type of guy.
We moved on to Chestnut Hill and had a great sit-down with some family. We helped them set up for the big day, and then moved on to Fitchburg for a mellow, three-person holiday with Megan’s dad. It was snowing, and the roads were awful. An hour drive turned into a nerve-racking 2 hours.
We made it, and we had a lovely and relaxing time. We had steak, mashed potatoes, green beans, pumpkin pie, and blueberry pie. Megan declared that were celebrating “Steaksgiving”. I got some nice shots of Fitchburg after the snowstorm. John told me about a waterfall in Fitchburg that I’m itching to photograph. I’ll get it on Christmas.

