Skip to content

Fix MacBook Pro Optical Drive Problems

Yesterday I was greatly distraught when my MacBook Pro’s superdrive would not accept blank DVD-Rs. When I inserted a blank DVD-R it spun around for a bit, sped up, slowed down, stopped, then spit it back out at me with no error message. It read DVDs, burned CDs, and read CDs fine; but I could not get it to accept a blank DVD-R! I searched around and found information about the MacBook superdrive update which killed alot of people’s optical drives. I couldn’t remember if i installed the update or not, so I was fairly worried because I did not want to drop $400 to fix something which an Apple update broke. I tried a bunch of tricks to try to get my beloved superdrive to work, but to no avail…

Continue Reading

TextMate: Local CSS Validation

Although TextMate comes with a built in CSS validation command it would sometimes fail for me depending on where I was working from (some locations have proxy software on the main router). I rewrote the command in the style of the PHP-HTML validator I posted earlier. You can add more validation options using -F. I’ve only used this script on CSS only files, it might not work on inline CSS in HTML documents. [code lang=”bash”]#!/usr/bin/env ruby -wKU scope = scope.gsub!(/< /?style.*?>/, ”) open(‘|curl -sF file=@-;type=text/css -F lang=en’, ‘r+’) do |io| io < < scope io.close_write while io.gets $_.gsub!(//, '&') print $_ end end [/code]

Continue Reading

TextMate: W3C HTML Validation For Local PHP Files

It is impossible to validate local PHP files via the built in W3C validation that the TextMate HTML bundle provides because it does not parse the PHP code in the PHP document. I’ve modified the default validation script to retrieve the file using OS X’s built in apache server (the script assumes you have your files in the ~/Sites directory) so it will work for not only PHP, but any apache-interpreted language. I’ve added the ss option to the W3C validator, you can add/remove any validation options to the curl command as you see fit…

Continue Reading