FLASHGEN

April 7th, 2009

Just coded up a new tool to create the HTML code for embedding flash in a page. The tool uses different styles of embedding: Default, No JS, swfobject static & swfobject dynamic.

Try it out and tell me what you think.

flashgen screenshot

flashgen screenshot

PHP Date() Cheat Sheet

March 25th, 2009

Just finished a cheat sheet for the PHP Date() function. I can never remember any of the identifiers. Hope someone finds it useful!


date cheat sheet


Click here to download .PDF (250 Kb)

This Cheat Sheet is released under a Creative Commons License (Attribution, Non-Commercial, Share Alike).

PHP Power Set

January 22nd, 2009

Here is a snippet that shows how to get the power set of an array.

/**
* Takes the power set of a one dimensional array and returns a 2-D array.
* array(a,b,c) ->
* array(array(a),array(b),array(c),array(a,b),array(b,c),array(a,b,c))
*/
function powerSet($in,$minimumNumber = 1) {
   $count = count($in);
   $members = pow(2,$count);
   $return = array();
   for ($i = 0; $i < $members; $i++) {
      $b = sprintf("%0".$count."b",$i);
      $out = array();
      for ($j = 0; $j < $count; $j++) {
         if ($b{$j} == '1') $out[] = $in[$j];
      }
      if (count($out) >= $minimumNumber) {
         $return[] = $out;
      }
   }
   return $return;
}

Which browsers load images that have display:none or visibility:hidden?

January 15th, 2009

Turns out all of them, with the sole exception of Opera 9, and only for display:none. It looks like Opera is the only browser that cares about the speed of the browsing experience.

browsers tested: IE 7, IE 6, FF 3.0, Safari, Chrome and Opera 9.

Test Page:  http://janitor61.com/test/test.html

openallbrowsers.bat

January 7th, 2009

Here’s a Windows Batch file that will let you open a specific web page in all browsers. Look through it and comment out the browsers you don’t have installed.

 @echo off
echo ---------------------------
echo -- Open in all browsers  --
echo ---------------------------
:enter
echo Enter the URL:
set /p answer=URL:
echo Use "%answer%"?
set /p use=[Y/N]:
if /i "%use:~,1%" EQU "N" goto enter
REM == Opera ==
start "" "%programfiles%\Opera\opera.exe" "%answer%"
REM == Firefox ==
start "" "%programfiles%\Mozilla Firefox\firefox.exe" "%answer%"
REM == Safari ==
start "" "%programfiles%\Safari\Safari.exe" "%answer%"
REM == Internet Explorer ==
start "" "%programfiles%\Internet Explorer\iexplore.exe" "%answer%"
REM == MultipleIE (only if you have this installed) ==
start "" "%programfiles%\MultipleIEs\IE6\iexplore.exe" "%answer%"
REM == Chrome ==
start "" "%USERPROFILE%\Local Settings\Application Data\Google\Chrome\Application\chrome.exe" "%answer%"

What the SWF

November 26th, 2008

New SWF Properties application - What the SWF.