Yikes! It's Tzigla. http://t.co/1K2L1wqHfY
Author: Rocky Tripaldi
-
Discovering new music with Spotify’s…
Discovering new music with Spotify's SXSW playlist http://t.co/PXIjUKvTin
-
In Praise of Property Design…
In Praise of Property Design http://t.co/CYoh7Iaxxh
-

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 http://t.co/BkgSzU2mru
Diacritical typing with Mac OS http://t.co/BkgSzU2mru
-

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…
Using back-ticks with Slack mobile http://t.co/kMxcWZJu6p
-

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.

-
I’m starting a literary rap…
I'm starting a literary rap duo called Dictionary Douche and the Oxford Comma. #forRealTho #notReally
-

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;
}
} -
I don’t make websites. I…
I don't make websites. I write love letters to WordPress and sign my clients' names.
-
http://t.co/GWdIRU8HrV mmmm. Toddies.
http://t.co/GWdIRU8HrV mmmm. Toddies.
-
3 things to do in…
3 things to do in Pittsburgh if you only have 2 days http://t.co/XiViM4lJAw
-

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 PencilsQAQZZ http://t.co/krcYX2FSgs
Zen PencilsQAQZZ http://t.co/krcYX2FSgs
-

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 http://t.co/DJbLnerpJx
Transcendent Songs http://t.co/DJbLnerpJx

