Formatting Twitter’s Date/Time With PHP

Posted: August 18th, 2010 | Author: kn00tcn | Filed under: Tips/Tutorials
Tags: , , , , ,

This should save you a little googling. When you look at the XML that the Twitter API gives you, each tweet has a ‘created_at‘ timestamp.

It looks like this: Wed Aug 18 18:22:29 +0000 2010. Not too friendly, but it’s really simple to convert it to a unix timestamp, then format it with PHP’s date function.

Step 1: Make the unix timestamp with strtotime(). Now it’s turned into 1282155749, which is just what we need even though it looks worse.

Step 2: Format with date(). ‘l M j \- g:ia‘ turns it into ‘Wednesday Aug 18 – 12:22pm‘. You have total control of how it looks thanks to that date() function of PHP.

I pretty much dumped it all into a single line on one of the things I was working on. This is after I retrieved the XML into a variable called $xml.

echo date("l M j \- g:ia",strtotime($xml->status[0]->created_at));
Last Modified: August 18th, 2010
  • Share/Bookmark

No Comments »

ATI Catalyst 10.7 Major Crossfire Issue

Posted: August 1st, 2010 | Author: kn00tcn | Filed under: Hardware
Tags: , , , , ,

Today I installed Catalyst 10.7 drivers after skipping 10.6 from hearing some horror stories. I’m with a 4870×2 using Vista64. The installation went smoothly, including the HDMI install. (A year ago the HDMI installer failed on one release, worked on the next month’s release.)

After some testing, there’s a severe problem with the 2d/3d detection, so far with the second core.

With DX9 and OGL games, the second core does not switch between 2d and 3d speeds. On a fresh boot, it stays idle after launching a game. This mismatch makes games really stuttery, especially if they are more demanding. The DX9 games I tested were: Borderlands, Call of Duty Modern Warfare 2, Far Cry 2, Lead and Gold, Mirror’s Edge, Moonbase Alpha, Need for Speed SHIFT, Serious Sam HD.

Mirror’s Edge managed to flip the second core into 3d, but then it got stuck after exiting! I checked Borderlands and it was as smooth as it was before (some areas can dip to ~45fps). Lead and Gold finally has a crossfire profile in the drivers, so now that the second core was in 3d mode, the game was nice and smooth without the huge flicker and ~40fps from before.

DirectX 10/11 games I tested (Battlefield Bad Company 2, Red Faction Guerrilla, Shattered Horizon) work just fine. Launching and exiting flips both cores correctly into 2d/3d. Even after Mirror’s Edge locks the second core into 3D, you could reset it back to idle speed by opening and closing a DX10 game.

If there is no hotfix, it might still be possible to take a specific .dll from 10.5 or 10.6 and put it in the Windows system folder so you can still use the new game profiles of 10.7.

Last Modified: August 2nd, 2010
  • Share/Bookmark

5 Comments »

Upgraded to WordPress 3

Posted: July 15th, 2010 | Author: kn00tcn | Filed under: Software
Tags: ,

That went pretty smoothly.

I did a manual upgrade by putting a temporary index.html in the WP root and renaming the existing index.php, deleting everything except wp-content, then uploading the new WP3 files. No issues with old plugins from a year ago, or with some of the PHP that the theme uses.

Last Modified: July 15th, 2010
  • Share/Bookmark

No Comments »

Disable WordPress’s Visual Editor On Specific Posts

Posted: July 11th, 2010 | Author: kn00tcn | Filed under: Tips/Tutorials
Tags: , , ,

Simple and quick tip for WordPress. You might run into this if you have code snippets or other things in the HTML view that get malformed once you enter the visual view of the editor.

This WP plugin covers the basic functionality. The minor issue is that you have to open the post’s edit view to input the custom field, instead of having a button in the list of posts section of the admin area. Maybe there is a plugin for editing custom fields ajax-style, or a richer version of this visual/html toggle that I may have missed.

Last Modified: July 11th, 2010
  • Share/Bookmark

No Comments »

Disable Auto-Eject On Empty Drives

Posted: July 6th, 2010 | Author: kn00tcn | Filed under: Tips/Tutorials
Tags: , , ,

Have you tried to double click on a hard drive in MyComputer, only to accidentally click your optical drive and have it eject? This gets annoying if you’re trying to be quiet at night, or if you have one of those cases with a door that covers up the drive bays. Luckily it’s a simple fix, but you won’t be able to use the built in Windows burning functionality. You should be able to still use third-party burning tools like ImgBurn just fine. (In fact I need my options and project files, so I’m never using built in OS stuff anyway)

In the registry, go to: HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer

Add a DWORD called NoCDBurning and set it to 1.

That’s it. Log off and on again to make it work. This might be just a Vista and 7 feature, but try it on XP if it ejects as well.

Last Modified: July 6th, 2010
  • Share/Bookmark

No Comments »

Router Uptime Record: 312 days

Posted: July 3rd, 2010 | Author: kn00tcn | Filed under: Hardware
Tags: , , , ,

Well, the building had short power outage for less than a second, so finally I can stop saving a screenshot everyday. I’m using the WRT54GL with some outdated DD-WRT firmware and it’s been quite stable as you can see. The image was taken at around 2am while the reset happened around early next afternoon, so ~312.5 days.

Inb4 ‘get a UPS’.

Last Modified: July 3rd, 2010
  • Share/Bookmark

No Comments »

TTC Streetcar Papercraft

Posted: June 17th, 2010 | Author: kn00tcn | Filed under: Media
Tags: , , , , ,

Here’s a papercraft of a TTC streetcar (tram) that was given when visiting the TTC bus garage during Doors Open Toronto. Now the instructions are really vague… I had a hard time building this. For example, the trolley pull just says ‘Join parts B and C‘: Does the slit face the front or the rear? Which way do I angle the trolley pole? I ended up using a little tape to keep it from falling in either direction.

Anyway it looks alright. I want to make some others, like these cool Team Fortress 2 ones. Maybe one day I’ll design my own.

Last Modified: June 17th, 2010
  • Share/Bookmark

No Comments »

kn00tcn – Saturday Stroll

Posted: June 11th, 2010 | Author: kn00tcn | Filed under: Hip-Hop

Description: A Light chilled somewhat jazzy beat, just for the weekend
or a lazy day. Similar to ‘Sunday Stroll‘.
Started: November 2006
Completed: April 2008

Audio clip: Adobe Flash Player (version 9 or above) is required to play this audio clip. Download the latest version here. You also need to have JavaScript enabled in your browser.

http://www.mediafire.com/?znnzmyxtkgx

WTFLameIt\'s OKPretty CoolAwesome! (No Ratings Yet)
Loading ... Loading ...
Last Modified: June 11th, 2010
  • Share/Bookmark

No Comments »

kn00tcn – Do It

Posted: June 11th, 2010 | Author: kn00tcn | Filed under: Hip-Hop

Description: Scratched up vocal samples scatter throughout this laid back
track, reminiscent of 90s hip-hop.
Started: September 2008
Completed: September 2008, 30 minutes start to finish.

Audio clip: Adobe Flash Player (version 9 or above) is required to play this audio clip. Download the latest version here. You also need to have JavaScript enabled in your browser.

http://www.mediafire.com/?kyykmrjnwjg

WTFLameIt\'s OKPretty CoolAwesome! (1 votes, average: 3.00 out of 5)
Loading ... Loading ...
Last Modified: June 11th, 2010
  • Share/Bookmark

No Comments »

kn00tcn – Sunday Stroll

Posted: June 11th, 2010 | Author: kn00tcn | Filed under: Hip-Hop

Description: A Light chilled beat, perfect for the weekend or a lazy day. The mastering and arrangement was done well after the idea.
Started: July 2006
Completed: February 2009

Audio clip: Adobe Flash Player (version 9 or above) is required to play this audio clip. Download the latest version here. You also need to have JavaScript enabled in your browser.

http://www.mediafire.com/?ydnyimdnq1y

WTFLameIt\'s OKPretty CoolAwesome! (No Ratings Yet)
Loading ... Loading ...
Last Modified: July 15th, 2010
  • Share/Bookmark

No Comments »
Page 1 of 3123