Mini-Meatloafs

Ingredients

  • 1 pound lean ground beef
  • 2 tbsp Worcestershire sauce
  • 1 egg
  • 2 tbsp ketchup
  • 1 clove garlic
  • 1 tsp sea salt
  • 1/2 small onion diced fine
  • 1/2 small green pepper diced fine
  • 1 tsp sugar
  • 1/4 tsp black pepper
  • 1 clove garlic diced fine
  • 1 tsp extra virgin olive oil

Directions

  1. Combine the onion, green pepper, olive oil, sugar, garlic, and black pepper in a small pan and saute on medium heat five minutes or until tender.
  2. Combine the egg, worcestershire, ketchup, salt, ground beef, and vegetable mixture in a large bowl and hand mix until all ingredients are evenly distributed. Form into two evenly sized bricks and brown in a skillet over medium heat for 3-4 minutes per side.
  3. Transfer to a baking dish, cover with tinfoil, and bake at 425 for 30 minutes.
  4. Serve over sauteed potatoes and carrots and enjoy!

Add a pageview column with Jetpack data source

I decided to get with the times and give Jetpack a try. If you’re unfamiliar with Jetpack, it’s essentially a WordPress plugin which ties your self-hosted WordPress blog to WordPress.com’s servers and allows nifty features like an image CDN, Gravatar hovercards, centralized comments, and a multitude of other features. Personally, I love the WordPress.com stats the most.

I missed my views column on my posts page in admin though (which I used to source from my Better Postviews plugin). So I wrote up this little function to get the data from Jetpack servers and happily place it where it belongs. Here is the code to do so:

[php]
<?php // Add a Views columns to insert jetpack postviews data into function rdc_add_views_column( $cols ) { $cols[‘pageviews’] = ‘Views’; return $cols; } add_filter( ‘manage_edit-post_columns’, ‘rdc_add_views_column’ ); // Grab and display the postviews data from Jetpack for each post function rdc_add_views_col_data( $colname ) { global $post; // Make sure we’re inserting into the correct column if ( ‘pageviews’ !== $colname ) return false; // Make sure jetpack and stats are available if ( ! ( class_exists( ‘Jetpack’ ) &amp;&amp; Jetpack::is_module_active( ‘stats’ ) ) ) { echo ‘Error’; return false; } // Make sure stats_get_csv is available if ( ! function_exists( ‘stats_get_csv’ ) ) { echo ‘Error’; return false; } // Try to get view count from post meta "cache" $view_count = get_post_meta( $post->ID, ‘_jetpack_post_views_count’, true );
$view_count_created = absint( get_post_meta( $post->ID, ‘_jetpack_post_views_count_created’, true ) );

// No "cache" value, hit the API for the value
if ( ! $view_count || time() > $view_count_created + 3600 ) {
// Get the post data from Jetpack
$postviews = stats_get_csv( ‘postviews’, "post_id={$post->ID}" );

// We have a problem if there was no data returned
if ( ! $postviews ) {
echo ‘Error’;
return false;
}

// Get view count from returned results
$view_count = absint( $postviews[0][‘views’] );

// Store the value and time as post meta
update_post_meta( $post->ID, ‘_jetpack_post_views_count’, absint( $view_count ) );
update_post_meta( $post->ID, ‘_jetpack_post_views_count_created’, absint( time() ) );
}

// Print Jetpack post views
echo ‘<strong>’ . number_format( absint( $view_count ) ) . ‘</strong>’;
}
add_action( ‘manage_posts_custom_column’, ‘rdc_add_views_col_data’ );
[/php]

Drop that code into your functions.php or another theme file. Also, if you’re REALLY scaling up, you’re probably using something like Varnish cache and the Better Postviews Plugin may not register an accurate view count. If that’s the case, Jetpack may be for you since WordPress.com stats are javascript based.

There are a ton of other metrics which you can pull from Jetpack also – check out George Stephanis’ slides from WordCamp Boston 2013 for some more info.

Enjoy!

Slow Cooked Curry Chicken

It’s been a while since I published a recipe – to be honest, it’s been a while since I wrote a recipe and just as long since I did any serious cooking. I’ve just been so busy working and writing code that I haven’t had a chance to write anything else. Tina has also really stepped up and decided to enjoy cooking, so I rarely get a chance to get into the kitchen any more. After waking at 3AM with Rylan and seeing a similar recipe on a late-night cooking show, i decided to give this a shot this morning. They go great with Corona Light and Sunday football!

I hope you enjoy these tasty slow-cooked curry chicken thighs, they truly are delicious.

Ingredients

  • 8 Chicken Thighs
  • 4 Tbsp Yellow Curry Powder
  • 1 Tbsp Chinese 5-spice Powder
  • 2/3 Cup Orange Juice
  • 1 Tbsp peanut oil
  • 1 Tbsp sesame oil
  • 1 Tbsp chili oil
  • Salt & Pepper

Directions

  1. Brown the chicken thighs over medium-high heat in the peanut oil. Sprinkle salt and pepper over the chicken while it’s cooking. Cook for 3-4 minutes per side or until golden brown.
  2. Combine all other ingredients into a slow-cooker / crock pot.
  3. Add browned chicken thighs to crock pot and cook on High for 4-6 hours until the chicken falls off the bone.
  4. Remove chicken from juice and serve warm with fried rice and vegetables.
  5. Enjoy!

Graphite Graphs for WordPress

It’s no secret that I love Graphite. My co-workers think it’s a bit ridiculous how much data I feed into our graphite server. I may be a bit excessive, but I have a monitor in my office which allows me to see at a glance every little detail about our network in real time – server health, pageviews, Google Pagespeed Insight scores, etc. I can’t even describe how wonderful a tool it is.

I wanted an easy way to display graphite graphs on the WordPress dashboard. So I rolled out a plugin over the weekend. I give you WordPress Graphite Graphs – I admit I [somewhat] got the idea from WPVIP’s “page generation time” graph in the VIP dashboard, but I’m sure they won’t mind. This plugin allows me (or you) to rapidly deploy monitoring graphs across many different sites without a lot of hassle and NO custom code for each site. Just plug in the URL of your graphite server, the metrics you want to display, and viola – Graphy delight! While I was at it, I went ahead and added support for graphs on the front-end in the sidebar that can be hidden from non-users if needed. Why not, right?

Shoot me a tweet if you’re interested in additional features or get in on the action and fork it on github.