Best Christmas Decoration Ever

Make sure to read story at bottom…

best-christmas-decoration-ever

Fantastic!

"Good news is that I truly out did myself this year with my Christmas  decorations.

The bad news is that I had to take him down after 2 days.

I had more people come screaming up to my house than ever. Great stories. But two things made me take it down.

First, the cops advised me that it would cause traffic accidents as they almost wrecked when they drove by.

Second, a 55 year old lady grabbed the 75 pound ladder almost killed herself putting it against my house and didn’t realize it was fake until she climbed to the top (she was not happy).

By the way, she was one of many people who attempted to do that.

My yard couldn’t take it either.

I have more than a few tire tracks where people literally drove up my yard."

Apple to replace magsafe adapters even out-of-warranty

After doing some researching and finding videos showing how to re-solder the cable and stuff, I stumble upon this page:

http://support.apple.com/kb/TS1713?viewlocale=en_US

And thought it was worth a shot going to the apple store here in Pasadena. So I made an appointment and in about 15 minutes I got a new magsafe adapter at no cost.  🙂

Old MagSafe adapter

Here’s a shot of the new one:

New MagSafe Adatper

Redirecting to another page when Flash is not installed

For all you that need to redirect users to another page if they don’t have Flash installed and use swfobject, just drop this code and you’re good to go:

var playerVersion = swfobject.getFlashPlayerVersion(); // returns a JavaScript object
var majorVersion = playerVersion.major; // access the major, minor and release version numbers via their respective properties

if (majorVersion == 0)
{
 document.location = '/PAGE_THE_USER_SHOULD_BE_REDIRECTED_TO';
}

This should go just before:

swfobject.embedSWF("xmas/happy_christimas_2009.swf", "flashcontent", "100%", "100%", "10", false, flashvars, params, attributes);

Let me know if you have a different approach.

I have found this (http://pastie.org/433193 ) while searching for a solution to my problem, but it made more sense to rely on swfobject API since I was already using it to embed flash.

Solving Firefox 3.5.5 slow response and high CPU usage

Tonight I got fed up of Firefox 3.5.x eating up CPU cycles and not being responsive…. So I decided to google that to see what other have experienced and tried.

After uninstalling Flash (just to be sure as it seems it was not guilty this time 🙂 ), I tried looking for thing in the configuration.

You type in the URL address bar:  "about:config" (without quotes). Confirm that you’re going to be careful.

The setting I disabled (and didn’t even have to re-start to notice better response times was:

security.enable_java

It is now set to false, as I don’t care about java on my browser.

I do use Eclipse while programming, so Java is still installed on my computer.

Let me know if that helps you.

A base controller using Kohana v3.0.3

Here’s how I created a base controller for websites I develop using Kohana v3

1. create a website config file ( application/config/website.php ):

<?php defined('SYSPATH') OR die('No Direct Script Access');
return array( 'site_name' => 'Example site',);
<?php defined('SYSPATH') OR die('No Direct Script Access');
return array(
      'site_name'  => 'Example site',
);

2. Create a basic CSS file for your site ( html/template/default/css/style.css ):

body {
      font-size: 14px;
}

3. Create the website controller ( application/classes/controller/website.php ):

<?php defined('SYSPATH') or die('No direct script access.');
class Controller_Website extends Controller_Template {
      public $template  = '';
      public $page_title  = '';
      public $site_name  = '';
      public $template_name  = '';
      public $styles  = array();
      public $scripts  = array();
      public function before()
      {
            $this->auto_render = false;
            parent::before();
            $this->auto_render = true;
            $this->template_name = 'default';
            $this->site_name = kohana::config('website.site_name');
            $this->styles = array(
            'template/' . $this->template_name . '/css/style.css' => 'screen',
      );
      $this->scripts = array(
            'http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js',
      );
      $this->template = View::factory('template/' . $this->template_name . '/default');
      if ($this->auto_render)
      {
            $this->template->bind('page_title', $this->page_title)
            ->bind('site_name', $this->site_name)
            ->bind('styles', $this->styles)
            ->bind('scripts', $this->scripts)
      ;
      }
      }
      public function action_index()
  {
  //$this->request->response = 'hello, world!';
  $this->template->content= '<!--Default website controller, you don't want to access this one-->';
  }
  public function after()
  {
  $this->template->bind('styles', $this->styles)
  ->bind('scripts', $this->scripts)
  ;
  parent::after();
  }
} // End Website

4. Create the template file ( application/views/template/default/default.php ):

<html>
  <head>
  <meta charset="utf-8" />
  <title><?php echo empty($page_name) ? '' : "$page_name - "; ?><?php echo empty($site_title) ? '' : $site_name; ?></title>
  <?php foreach ($styles as $file => $type) echo HTML::style($file, array('media' => $type)) . "n"; ?>
  <?php foreach ($scripts as $file) echo HTML::script($file) . "n"; ?>
  </head>
<body>
  <?php echo empty($content) ? '' : $content; ?>
</body>
</html>

Removing "index.php" from kohana v3 urls

Now that you have Kohana v3 installed, let’s remove "index.php" from all the URLs to help our SEO capabilities.
Rename the file "example.htaccess" to ".htaccess" or merge its contents if you already have one in place.
You should change the line:

RewriteBase /kohana

to point to the folder where your "index.php" file is.
Next file you will change is "application/bootstrap.php".
You need to change the line:

Kohana::init(array('base_url' => '/kohana/'));

To:

Kohana::init(array(
    'base_url' => '/',
    'index_file' => '',
));

My "index.php" file is not on a "kohana" folder, so I changed both "RewriteBase" and "base_url" to "/", as I am gonna user Kohana for all content (except static content).

  • IGlr