Indemnity83

Ramblings and musings of a technology addict

Aside

Status of Scion Userbars

leave a comment

The script has been updated to include the 2012 models and release series information!

In late 2007 I made a set of Scion specific userbars because I got frustrated by people with huge pictures of their cars in their signatures, I was hoping they would catch on so that signatures would get smaller, and they did.

About a year ago, while updating images for ’08, ’09 and ’10 I decided to build a script that generates the images dynamically to make it easier to continue updating models, years and colors and I had plans to add additional user customization features so people can roll their entire mod list into an animated userbar that cycles through each item, reducing the size of the signature even further.

I still want to formalize this project, and continue adding features but for the time being the project has lost a bit of traction and is on-hold. I’ve updated the colors, release series information and models for the 2011 model year, so everything is current and I plan on leaving them up indefinitely.

How-To Build Your Bar

The script takes a specially formatted filename in the url and returns an image. The ONLY part of the URL that ever changes is the filename you are requesting. The URL will always look similar to this:

http://cdn.indemnity83.com/scion/05bsptc.gif

The bold text is the only thing you have to change; for a standard scion production vehicle the filename is made up of 3 pieces of information:

  1. The two-digit year (e.g. ’05′, et. all)
  2. The color code (see table below)
  3. The model (e.g. ‘tc’, ‘xa’, ‘xb’ or ‘xd’)

If you have a release series, the structure is similar but only has two required pieces of information and an optional third:

  1. The RS number (e.g. ‘rs1′, ‘rs3′, et. all)
  2. The model (e.g. ‘tc’, ‘xa’, ‘xb’ or ‘xd’)
  3. Optionally, you can put the production number in the filename to have it shown on your bar (e.g. ’350′, ’1275′). Note that the script already knows how many of each RS were made, you ONLY have to put your number.

Using On A Forum

Forums use a special kind of markup called BBCode, if you want to use the image as a signature or in the body of a post on a forum you’ll need to wrap the image url with [image] tags, like this:

[img]http://cdn.indemnity83.com/scion/05bsptc.gif[/img]

Inserting in a Website

To get the image to show up in a webpage, you’ll need to use the html tag, as an example:

<img src=”http://cdn.indemnity83.com/scion/05bsptc.gif” />

List of Color Codes

  •   AR — Absolutely Red
  •   AP — Azure Pearl
  •   BCP — Black Cherry Pearl
  •   BSP — Black Sand Pearl
  •   BBM — Blue Blitz Mica
  •   BP — Blizzard Pearl
  •   BR — Blue Ribbon Metallic
  •   CSM — Classic Silver Metallic
  •   FM — Flint Mica
  •   GGM — Galactic Gray Mica
  •   GB — Gloss Black
  •   IIP — Indigo Ink Pearl
  •   NBM — Nautical Blue Metallic
  •   SSM — Silver Streak Mica
  •   SCM — Sizzling Crimson Mica
  •   SW — Super White
  •   WLP — Wave Line Pearl
  •   BRM — Barcelona Red Metallic
  •   BCM — Black Currant Metallic
  •   EW — Electric Wasabi
  •   HL — Hot Lava
  •   MGM — Magnetic Gray Metallic
  •   BBCM — Blackberry Crush Metallic
  •   GRM — Gold Rush Mica
  •   HTM — Hypnotic Teal Mica
  •   M — Murasaki
  •   SRM — Stingray Metallic
  •   BOP — Blue Onyx Pearl
  •   CM — Camouflage Metallic
  •   EG — Envy Green
  •   PW — Polar White
  •   SRP — Salsa Red Pearl
  •   SM — Shadow Mica
  •   SY — Solar Yellow
  •   TCM — Thunder Cloud Metallic
  •   TP — Torched Penny
  •   PGP — Phantom Gray Pearl
  •   SBM — Spectra Blue Mica
  •   B — Black
  •   C — Cement
  •   ARM — Army Rock Metallic
  •   EBM — Elusive Blue Metallic
  •   VB — Voodoo Blue
  •   AGM — Amazon Green Metallic
  •   XP — xPresso
  •   SB — Speedway Blue
  •   PBM — Pacific Blue Metallic
  •   HV — High Voltage

A Few Other Notes

  • The script uses file caching to speed up renders and browser headers to speed up downloads. So these images should load VERY FAST (as in, hundredths of seconds).
  • Unless you absolutely have to, I don’t recommend downloading the image and uploading to your site/forum manually. Browsers won’t know that your image is the same as my copy, and it will have to be downloaded multiple times by the client. Also, you wont get any of the updates I make to the script.

Written by Kyle

March 19th, 2011 at 3:47 pm

Aside

WooTumblog

leave a comment

A large part of the redesign of this website centered around creating a Tumblr style blog where I could post more than just overly long winded stories. I explored moving to Tumblr directly, but didn’t like how it limited me to JUST the stream. Besides I have my own dedicated server in a fancy-pants collocation data center that I’m not ready to abandon. After reading some reviews, and doing some poking around I decided to use the WooTumblog plugin from the guys over at WooThemes to power the site. Primarily because they have an iPhone app (Express for WordPress) that lets me quickly post different content types without having to muck about with post-types myself. As I worked with the theme and the plugin I found a couple things were lacking in an otherwise superb and well polished plugin.

  • Embedded content widths. The admin settings for the plugin lets you set a width for images, and even includes a script for dynamically resizing and caching images at that size. There’s also some very fancy scripting that will read the width and height of embedded videos and resizes them, maintaining the aspect ratio. But the videos (and embedded audio player) were hard coded to be 440px wide.
  • Custom styles. The plugin has a built-in front-end style sheet that automatically gets pushed out, which is generally great. But I wanted/needed to apply my own custom style to the post icons on each post. There was no built-in way to disable the style sheet so your own theme’s style’s could run the show.
  • Missing CSS Selectors. Probably less important, but the post type class was only being applied to a new <span> element appended before the heading of each post. For some post types I wanted to be able to style the actual title differently (for example, the hover action of a link post).

I thought I would be clever, and tweak the plugin to resolve all these issues. I went and changed the hard-coded width of embedded content to match my site, made some changes to the title function so it would put the post type class in the tag and deleted the content from the front end css file. Then a few days later WooThemes released an updated version of the plugin. I updated and re-hacked the files. Eight days later, another set of bug fixes, and another release and I thought this is silly, I can’t keep hacking this file every time there is an update. So I took some time tonight and created elegant changes to the plugin to add the options I needed, making sure everything was compatible with the standard plugin, and did it all in SVN so I can just merge my changes into future releases.

Changelog

  • classes/wootumblog.class.php – Added option to disable default Woo Tumblog style sheet.
  • classes/wootumblog.class.php – Added options to set embedded video and audio player widths (see note below for more on this).
  • functions/wootumblog_template_functions.php – Changed hard-coded widths for embedded video and audio players to use new options (see note below for more on this).
  • functions/wootumblog_template_functions.php - Added class to titles for better CSS selection.

Note about video and audio width settings

I would guess that in 95% site designs, the width of images, embedded video and embedded audio will all be the same (as is the case in this blog). However, there are some occasions where you might need images to be a few pixels narrower to account for a border style of some kind, or maybe you want to float the audio player and have text wrap around it. Thinking about increasing the portability of this plugin, I decided that it was important to have separate options for each of the elements. If you (like me) just want them all to be the same, leave the width for the video and audio players at 0 (which is the default), and they’ll automatically conform to the image width setting.

Download

I plan on proposing these change to Jeffikus of WooThemes so they become part of the plugin but until that happens, I’ve packaged up my modified code, added a .1 to the version and a link in the description to this post (in case somebody stumbles on the zip without any reference). Since I didn’t change the title or folder of the plugin, when WooThemes releases the next version WordPress will prompt you to update the plugin and overwrite my tweaks (unless 2.0.4 IS my tweaks). I’ll maintain a version that includes my tweaks for as long as necessary (I have to do it for my site anyway) so just check back here when there is an update available.

Download WooTumblog 2.0.3.1 - 342.07 kB
Create a tumblr style blog using this plugin. Modifed by Indemnity83. For more information please check out the related post.

Written by Kyle

March 16th, 2011 at 10:50 pm

Quote

Reason #8

leave a comment

In Sacramento, the Kings are the big draw. In Los Angeles, there are two NBA teams, a college program (UCLA) that treats itself like an NBA team, a football program (USC) that treats itself like an NFL team when it's not on probation, two NHL teams, two MLB teams, an NFL team an hour away, another MLB team an hour away, beaches, Disneyland, Charlie Sheen, the sun, Korean BBQ and so, so much more.
Tom Ziller

Written by Kyle

March 16th, 2011 at 1:24 pm

Link

SacDeflated

leave a comment

If the Kings leave Sacramento, we all lose; they’re important in giving our city an Identity and they have so much potential for brining the city through an economic slump. Go show your support by Liking this cause; hopefully they’ll start motivating their fans with action items soon …

Written by Kyle

March 15th, 2011 at 3:35 pm

Link

WeightWire

leave a comment

Ten weeks ago today myself and 6 other friends started a “Biggest Loser” challenge. The challenge was to see who could lose the most weight by percent in the 10-week period. I setup WeightWire as a very quick CakePHP application to track each individual’s weigh-ins and present everything in a clean layout. I’m also very happy to say that Today I was able to best everybody by losing just over twenty pounds, roughly 10.5%. 

Written by Kyle

March 14th, 2011 at 3:44 pm

Image

Soon…

one comment

Soon…

Written by Kyle

March 10th, 2011 at 12:25 pm

Quote

A Dance With Dragons

leave a comment

A Dance With Dragons will be published on July 12. The manuscript is huge — the publisher estimates the hardcover edition will run more than 900 pages, putting it about the same length as the longest book in the series, A Storm of Swords. Schedule your summer vacation accordingly.
George R.R. Martin

Well this is certainly exciting news! The HBO show will be out April 17th and the LONG awaited next book just a month later. Going to be a busy summer for A Song of Ice and Fire fans.

Written by Kyle

March 6th, 2011 at 10:24 am

Image

Rainy Day

leave a comment

Rainy Day

Written by Kyle

March 6th, 2011 at 10:11 am

Aside

PHP Timer Class

leave a comment

So during the work to re-design the site, I was writing some functions and needed to test the execution time of some of my logic so I could optimize it. I Goggled up the standard microtime code and started copy and pasting it all over my scripts. After I had it copy and pasted in a few spots I realized, this is dumb … I’m duplicating code, this sounds like a job for a handy little helper class, and thus was born ScriptTimer. I’m sure that others have done this before, but here’s my go at it.

/**
 * PHP Timer
 *
 * This class is used to quickly capture timing information
 * of executed code.
 *
 * Usage example; basic in-code debugging:
 *     $timer = new ScriptTimer();
 * 	    ## Do some stuff ##
 *     $timer-&gt;halt();
 *
 * @author Kyle Klaus
 */
class ScriptTimer {
	var $starttime;
	var $endtime;
	var $totaltime;
	var $tare = 0;
 
	/**
	 * Constructor; determines tare, and (optionally) starts timer
	 *
	 * @param bool $start
	 */
	function ScriptTimer($start=true) {
		if( $start ) { $this-&gt;start(); }
	}
 
	/**
	 * Start the timer
	 */
	function start() {
		$mtime = microtime();
		$mtime = explode(' ', $mtime);
	    $mtime = $mtime[1] + $mtime[0];
	    $this-&gt;starttime = $mtime;
	}
 
	/**
	 * Stop the timer, and calculate execution time
	 */
	function stop() {
		$mtime = microtime();
		$mtime = explode(' ', $mtime);
		$mtime = $mtime[1] + $mtime[0];
		$this-&gt;endtime = $mtime;
		$this-&gt;totaltime = ($this-&gt;endtime - $this-&gt;starttime - $this-&gt;tare);
	}
 
	/**
	 * Returns the execution time string
	 *
	 * @param bool $stop
	 */
	function get_time($stop=true) {
		if( $stop ) { $this-&gt;stop(); }
		return 'Execution took ' .$this-&gt;totaltime. ' seconds.';
	}
 
	/**
	 * Outputs the execution time string
	 *
	 * @param $stop
	 */
	function time($stop=true) {
		echo $this-&gt;get_time($stop);
	}
 
	/**
	 * Halts execution and outputs the execution time string
	 */
	function halt() {
		die($this-&gt;get_time());
	}
}

Written by Kyle

September 22nd, 2010 at 5:30 am

Aside

Under Construction

leave a comment

© Zevotron

For the next few weeks, expect this site to be a little messy. I’ve you’re a previous visitor, you’ve likely noticed that I’ve re-done the site! This is pretty exciting for me, as it seems to be the thing I enjoy doing most of the site anyway, but the new design is a big departure from the previous theme, and some of the content was written and formatted to fit in the old design. You’ll probably notice this most with large pictures, not quite filling the width of the post.

I’ve done some minor testing and everything seems to be functional, but I’ll be going through all the content and rebuilding things for the new design. Until then, if you notice a problem just post a comment about it and I’ll try to get to it.

Some of the cooler features (that are ready anyway) are the large image views and galleries, click on the image below to get the full description and details.

http://www.flickr.com/photos/benny4bs/4904885051/

© Ben Matthews

http://www.flickr.com/photos/perturbao/4916282639/

© Perturbao

http://www.flickr.com/photos/seier/2263988203/

© Seier+Seier

 

Written by Kyle

September 19th, 2010 at 4:48 pm