jQuery.Buttonify plugin

For the project I’m working on at the moment, we needed a lot of buttons with different texts.
Initially each button was created as an image by the designer, multiple images where generated to manage different statuses (mouse over, button disabled, etc).

When you have 15 buttons in a project, it means managing 15*3 potential different images and requests to the server.

Looking at Best Practices for Speeding Up Your Web Site this clearly didn’t worked.

What I came out with is a jquery plugin that uses a little bit of javascript and a little bit of js, that allows you to have as many buttons as you want with a minimal overhead.

If you want to add a new button style, the only thing you need to do is to add a new set of css classes

.buttonify.newstyle,
a.buttonify.newstyle,
a.buttonify.newstyle:link,
a.buttonify.newstyle:visited
{
background:url(“/Scripts/buttonifier/css/images/bg_button_a_newstyle.gif”) no-repeat scroll right top transparent;
span
{
background:url(“Scripts/buttonifier/css/images/bg_button_span_newstyle.gif”) no-repeat scroll 0 0 transparent;
}
}

and you can use it in your page

have a look at the the example here

http://smnbss.github.com/jQuery.Buttonify/

Advertisements

Configuring Windows Media Center to work as it should – Can’t get .mp4 and .avi video’s to play in MCE

I’m configuring Windows Media Center on my Windows 7 laptop to stream videos from my NAS (http://www.netgear.com/stora).
I want to make sure everything work as I expect it before I start to order parts for my HTPC (http://smnbss.spaces.live.com/blog/cns!A117AA5E007A0648!1996.entry).

The media center easily recognize my Stora, and I was able to add the shared folders to the MCE configuration, but I couldn’t find most of the movies I had shared, just a couple of them. It turned out it’s a problem with the way the avi files are perceived from windows 7.

The solution was to merge this file into the windows registry

Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT.mpeg]
“Content Type”=”video/mpeg”
“PerceivedType”=”video”

[HKEY_CLASSES_ROOT.mpg]
“Content Type”=”video/mpeg”
“PerceivedType”=”video”

[HKEY_CLASSES_ROOT.avi]
“Content Type”=”video/avi”
“PerceivedType”=”video”

[HKEY_CLASSES_ROOT.m4v]
“Content Type”=”video/mp4”
“PerceivedType”=”video”

[HKEY_CLASSES_ROOT.asf]
“Content Type”=”video/x-ms-asf”
“PerceivedType”=”video”

[HKEY_CLASSES_ROOT.mov]
“Content Type”=”video/quicktime”
“PerceivedType”=”video”

[HKEY_CLASSES_ROOT.MPE]
“Content Type”=”video/mpeg”
“PerceivedType”=”video”

[HKEY_CLASSES_ROOT.wmv]
“Content Type”=”video/x-ms-wmv”
“PerceivedType”=”video”

My HTPC(Windows 7) & WHS all in one

What do you think?

CASE
EV Shiny Piano Black £49.99 http://goo.gl/gPxL or
PC-V351B £89.28 http://goo.gl/RRbC
MOBO
Zotac IONITX £109.54 http://amzn.to/aj7L40 or
A330ION £104.13 http://amzn.to/ckpuKM or
ASUS AT3N7A-I £148.45 http://amzn.to/9Dz21s
RAM
OCZ DDR3 PC3-10666 Gold £79.37 http://amzn.to/awepy7
HDD
Western Digital WD10EADS £66.70 http://amzn.to/b46eKz or
Western Digital 1.5TB £70.95 http://amzn.to/bBippB
BlueRay
Blue ray player £58.74 http://bit.ly/bkltNd

I’m planning to run WHS on a VM inside the HTPC running on Virtual PC on Windows 7.
At http://www.wegotserved.com they suggest to run windows 7 inside WHS , but I think the HTPC require a lot more power than WHS so I prefer to set it up the other way.

I also have a Netgear Stora, so I’m not even so sure I want to install WHS.

The idea was to partition the HDD in 3 parts

15% for the Windows 7 partition
15% for WHS Virtual Machine disk (in a separate partition)
70% storage

Now, the only thing I need to know is if it’s possible to map the 3rd partition as a disk on WHS VM

How to convert all your podcast for your ipod in a single click #2

Here I have an improved version of the previous script.

This version does not create a bat file but run the encoding directly, verify if the file has already been encoded, and if the file was processed completely ($inmedia.Properties.Duration.Minutes -ne $outmedia.Properties.Duration.Minutes)

What do you need:

This script should also set the metatag for the mp4 files but it does not work, I need to spend some time and investigate this problem

begin convert.ps1

————————————————————–

[Reflection.Assembly]::LoadFrom( (Resolve-Path “.taglib-sharp.dll”) )
$folders = get-childitem
Get-ChildItem $folders | Foreach {
if($_.Extension -eq ‘.mp4’ -or $_.Extension -eq ‘.wmv’ )
{
$in     = New-Object system.IO.FileInfo $_.fullname.ToString()
$indir  =  $in.Directory
$out    = New-Object system.IO.FileInfo $_.fullname.Replace(‘Podcasts’, ‘PodcastsEncoded’).Replace(‘.wmv’, ‘.mp4’)
$outdir = $out.Directory
$in        = New-Object system.IO.FileInfo $_.fullname.ToString()
$outdir.Create();

if(!$out.Exists)
{
.HandBrakeCLI.exe –input $in.fullname –output $out.fullname –preset=”iPod”
} else {
trap [Exception] {
.HandBrakeCLI.exe –input $in.fullname –output $out.fullname –preset=”iPod”
}
$inmedia = [TagLib.File]::Create($in.fullname)
$outmedia = [TagLib.File]::Create($out.fullname)
if($inmedia.Properties.Duration.Minutes -ne $outmedia.Properties.Duration.Minutes)
{
.HandBrakeCLI.exe –input $in.fullname –output $out.fullname –preset=”iPod”
}
}
$media = [TagLib.File]::Create($out.fullname)
$media.Tag.Title = $in.fullname.Replace($indir.fullname+””, “”);
$media.Tag.Album = $outdir.Name;
$media.Save()
}
}

————————————————————–