I’ve been meaning to finally update the design & content on this site, and finally I’ve gotten around to finishing up the design and updating the entire backend. I’ve updated wordpress and I’m still working out some issues with some plugins I was using; but for the most part everything is updated. There are some minor things I’ll be changing around over the next couple days but I’m hoping I’ll be able to jump right into posting some of new things I’ve been wanting to share over the last couple months.
Archive for the 'General' Category
Page 3 of 12
I’m finally, after almost four years, redesigning and refreshing this site. I’ve definitely neglected this site over the last couple years and have been devoting alot of my time to other endeavors in and out of the programming world. However I’m ready to reconvene and start posting regularly on this site again. I have alot of content I want to post that I’ve developed over the last year or so. I have updates to all my applications (both open-source and shareware) that I will post at sometime in the future as well as a new application that I will hopefully release within the coming months. I’m excited, and I hope you are too!
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. Finally while searching around on google someone suggested to get a CD cleaner. I went to Staples and picked one up for $10, put it into my optical drive, and bam it burns DVD-Rs again! I’m guessing the firmware update made the optical drive more sensitive to dust. If your having trouble with your MacBook’s optical drive I suggest grabbing one of these CD drive cleaners and trying your luck before resorting to bringing your computer back to the Apple store.
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
. I’ve only used this script on CSS only files, it might not work on inline CSS in HTML documents.
scope = STDIN.read
scope.gsub!(/< \/?style.*?>/, '')
open('|curl -sF file=@-\;type=text/css -F lang=en http://jigsaw.w3.org/css-validator/validator', 'r+') do |io|
io < < scope
io.close_write
while io.gets
$_.gsub!(/<\/title>/, '\&')
print $_
end
end
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
directory) so it will work for not only PHP, but any apache-interpreted language. I’ve added the
option to the W3C validator, you can add/remove any validation options to the
command as you see fit.
STDOUT.sync = true
page = `echo $TM_FILEPATH | sed "s|.*/$USER/Sites/|http://localhost/~$USER/|" | xargs curl -s`
open('|curl -sF uploaded_file=@-\;type=text/html -F ss=1 http://validator.w3.org/check', 'r+') do |io|
io < < page; io.close_write
while io.gets
$_.gsub!(/<\/title>/, '\&<base href="http://validator.w3.org/">')
puts $_
end
end
Hope everyone had a blessed and happy easter!
I’ve always wanted to attach a movieclip to the stage with a class other than MovieClip without having to use swfmill or the ide to create a movieclip with linkageID + custom class. Well that day is finally here! I found a nice snippet of code on the net and modified it a bit to act more like attachMovie (ability to specify an initOb). The result?
:s
Description: A function used for creating empty movie clips with subclass association.
Parameters:
c:Function - The class to associate with the the empty movie clip.
name:String - The instance name for the empty movie clip.
depth:Number - The depth for the empty movie clip.
initOb:Object - Optional, object to copy properties from
Returns:
MovieClip - A reference to the newly created movie clip.
*/
MovieClip.prototype.createClassMovieClip = function(c:Function, name:String, depth:Number, initOb:Object) : MovieClip {
var mc:MovieClip = this.createEmptyMovieClip(name, depth);
mc.__proto__ = c.prototype;
mc.constructor = c;
if(initOb) {
for(var prop in initOb) {
mc[prop] = initOb[prop];
}
}
c.call(mc);
return mc;
}
Use it just like
except you specify a class for the first parameter, eg:
Pretty slick!
Snipplr
Snipplr is a neat site I came across a couple months ago but forgot to post about. It a nicely designed web-2.0-ish site that allows you to post and view code snippets for various different languages (Cocoa, PHP, HTML, CSS, etc). It even has cloudtags and TextMate integration! I’ve been posting some smaller snippets on that site instead of the source code page, so go and check it out.
In the same vein, Code Beach was recently launched. Code Beach is basically the same idea as Snipplr, except it is focused solely on Cocoa based code snippets. It’s nice to see more of these code sharing sites cropping up, they save alot of time!