Archive for the ‘Geekery’ Category

27
Dec
2008



Hope you guys have had a really bloaty, drunk Holiday so far! THIS has to be one of the years cutest videos, must must watch it. Normal service will resume on HipHop in the new year… and it’s one of my resolutions to post more, too :)









City Creator

Oh man, I can see this website being very addictive. Also, did you see that google’s sketchup were having a gingerbread house competition? I’ve got sketchup so I might just have a go! although I’ve never really used the program properly before…





27
Nov
2008



I think I mentioned in last weeks ‘Weekly Good Stuff’ that I was having fun playing around with wordpress at work, and finding out just how powerful this blogging platform is… Well, I figured it would be good samaritan like of me to share the stuff I’ve been figuring out. Here’s the first tastey tidbit.

Pulling in meta/custom fields from other pages.

I needed to pull in some contact details for the sidebar on one page that already exsisted as custom fields (meta) on another page. I’ve been using the flutter plugin, but that’s basically just a fancy way to display custom fields in the admin (making it easier for end users, especially if you’re developing for people who ain’t so savvy). So, I needed to get this data from the entries on one page (contact) to the sidebar on another (about-us). After some googling and searching the WP forums, I found some code that kind of did the right thing. It references the actual database, and the post ID, so it’s not very versatile. However if you’re figuring the post ID of the page you need to reference isn’t gonna change, then you’re in business.

<?
$pages = $wpdb->get_results(”
SELECT * from $wpdb->posts
WHERE post_type=’page’
AND ID= ‘67′
ORDER BY post_title
“);
//the above checks the database for posts that are actually pages, it then (I think?) finds the ID //of the post you need by number. The order by probably doesn’t need to be there anymore, //but I left it in just incase!

foreach($pages as $page) :
$address_line_1 = get_post_meta($page->ID, ‘address_line_1′, $single = true);
$address_line_2 = get_post_meta($page->ID, ‘address_line_2′, $single = true);
$city = get_post_meta($page->ID, ‘city’, $single = true);
$postcode = get_post_meta($page->ID, ‘postcode’, $single = true);
$telephone = get_post_meta($page->ID, ‘telephone’, $single = true);
$fax = get_post_meta($page->ID, ‘fax’, $single = true);
$email = get_post_meta($page->ID, ‘email’, $single = true);
// this bit is to pull any meta from the child page
//in this case it’s the custom fields that are used to display the address/contact details.
//echo ‘<h2><a href=”‘ .  get_permalink($page->ID) .  ‘” title=”‘ . $page->post_title . ‘”>’ . //$page->post_title .  ‘</a></h2>’; //this would, if uncommented, show the page title.

// right, here I’m echoing the variables that exist in the page we’ve referenced (67 ie. contact)
echo ‘<li>’ . $address_line_1 . ‘ </a></li>’;
echo ‘<li>’ . $address_line_2 . ‘ </a></li>’;
echo ‘<li>’ . $city . ‘ </a></li>’;
echo ‘<li>’ . $postcode . ‘ </a></li>’;
echo ‘<li>Tel: ‘ . $telephone . ‘ </a></li>’;
echo ‘<li> Fax: ‘ . $fax . ‘ </a></li>’;
echo ‘<li>’ . $email . ‘ </a></li>’;
endforeach;
?>

There we go… now I’m no php developer, so this is probably really hacky/shit code… but it works hah. So, I figure if you need to use it, you can. Also, this is why hiphop ain’t so good, I spend my time finding out shit for other sites! Bah. Soon, soon.








So I turned on the XBox earlier, and it made me do this major update. Turns out microsoft has a jonesing for some nintendo action, and alongside a whole new interface/menu we’ve also got some extremely Wii-ish avatar’s going on. It’s so random and weird! Anyway, apparently in the US you can stream netflix through it, for us over here in the UK though I’m not really sure what’s different? We’ll see, haven’t really had a good look around it yet.








So, I do a lot of print screening, grabbing etc to get bits from one place to another quickly (it’s super good for getting css rendering quirks from diff browsers logged!). On my old mac that I didn’t really use for work I never had the need to do such things. Well, now that I do, I’m amazed at the capabilities of the grab function!

Here’s a handy reference list of the keyboard shortcuts to use when you want to grab things

  • Shift-cmd-3 will capture the whole screen to a file on your desktop
  • Shift-cmd-4 will bring up a crosshair where you can select an area of your screen to grab and save to a file on your desktop.
  • Shift-cmd-4, then space, then click a window will capture that window as a file to your desktop
  • Holding down ctrl with any of the above will save it to your clipboard, handy for taking things to fireworks/photoshop

Super cool.