How to Convert a PSD to an HTML Website
Find the Largest Files on Your Computer
If you’re like me, hard drives never seem big enough. My hard drive could make an appearance on the TV show Hoarders. I knew that I had a lot of large, unneeded files on my hard drive, so I wrote a simple power shell script to find the top 50 largest files on my computer.
If you don’t have power shell installed, follow the instructions in this article.
If you’re not sure how to run a powershell script, check out this selected answer on StackExchange.
JS Lint: Too many var statements
It is generally best practice to have only one var statement per scope block in JavaScript. If the “Require only one var per function” option is checked in JS Lint (of JS Hint), it will issue a warning about it. You can either deselect the option in JS Lint, or modify your var statements to use the one var declaration syntax as seen below.
var myFunction = function(){
var firstVariable = ‘test’,
secondVariable = ‘check’,
thirdVariable = ‘fail’;
}
JS Lint: Missing ‘new’ prefix when invoking a constructor
When you have a function that starts with a capital letter, JS Lint (and JS Hint) will consider it a constructor since that is the traditional constructor syntax. JS Lint will throw the error “JS Lint: Missing ‘new’ prefix when invoking a constructor.” It’s generally best practice to start your function names with a lowercase letter unless you are creating a constructor. This will keep JS Lint from barking at you about it.
var BadFunctionName = function(){
// DO STUFF
}
var goodFunctionName = function(){
// DO STUFF
}
SWF CSS Display Change Causes Reload in Firefox and Chrome
Ran into an interesting issue today. Apparently if you’re using display:none to toggle the visibility of a flash (swf) file, it will reload the content once the display is changed from none to another value (block in my case). This apparently only happens in Firefox and Chrome. This generally isn’t an bandwidth problem since swf files are cached in the browser and re-loaded from there, but it would cause issues if your swf content had any type of application properties or needs to maintain state.
The solution appears to be to use visibility:hidden instead of display:none, but I realize that is not a cross-browser solution for IE. If this is causing an issue for you, you might need to use an !important tag or two here to get IE to work properly. Anyone have a more elegant solution?
Side note: You’ll also notice that IE loads all swf objects that are set to display:none on page load, while Firefox and Chrome do not.
iPad 2 gets a Smart Cover
“We can’t say we were expecting to be impressed by a case for the new iPad 2, but Apple’s pulled something of a surprise out its hat with its new Smart Covers for the tablet. Available in multiple colors and in your choice of polyurethane or leather variants, the covers attach to the iPad with a self-aligning magnetic hinge and can also be folded into a triangle and used as a stand. What’s more, they’ll automatically wake or put your iPad to sleep when you open or close the cover, and they even pack a microfiber lining that cleans your screen each time you flip it open. As Steve Jobs explained, Apple designed the covers right alongside the iPad itself and, as he points out, ‘it’s not a case — it’s a cover.’ Look for the poly covers to set you back $39, while the leather ones will run $69 apiece — video is after the break.”
Source: engadet.com
iOS 4.3: What we know
Here is what we know about iOS 4.3
- Launches March 11, 2011 along-side iPad 2 launch
- Compatible with iPad, iPhone (GSM), iPod touch (3rd & 4th gen)
- Safari performance
- Nitro JavaScript engine
- iTunes home sharing (WiFi Sync?)
- AirPlay improvements
- Preference for iPad switch
- Mute or rotation lock
- Personal hotspot (iPhone 4 only)
- Photobooth
- FaceTime for iPad 2
- iMovie ($4.99)
- Garage band ($4.99)
iPad 2: What we know
Here is what we know about the iPad 2.
- All new design
- 33% thinner than original (thinner than iPhone 4) - 13.4mm to 8.8mm
- 1.3 lbs (original iPad is 1.5 lbs)
- White and Black iPad 2
- Gyroscope
- Same battery life
- Dual core, A5 processor
- Up to 2X faster CPU
- Up to 9X faster graphics
- Video Cameras
- Front and rear facing
- Same price point
- HDMI out
- Cover (not a case) that wakes the iPad up when opened
- Launches March 11, 2011 in 26 countries