Skip to content

CSS Compression Web Service

I’ve been making more use of my css optimizer in my recent web projects and put some work into creating an automated compression system for css and javascript files in a web project. In an effort to release a script that automates the compression of css and javascript files without compromising the ease of development and debugging I’ve setup a css optimizer service allowing you to use css optimizer without using the web interface or downloading the command line application. Here is how to access this service through the curl command line application: [code lang=”bash”] # compression on local css file curl http://mabblog.com/cssoptimizer/service.php -F “data=

Continue Reading

STM Evolution Laptop Backpack

About a year ago I was able to get a MacBook Pro at an incredible low price. I’ve had many of my friends break their laptop screens simply by walking from one location to another because of inadequate padding and protection and I didn’t want my laptop to suffer a similar fate. Putting the laptop in a incase sleeve wasn’t going to do it for me, and I didn’t want to lug around a ‘laptop bag’; I wanted a backpack specially designed for laptops. Luckily, to my surprise, I found exactly what I was looking for – the STM Evolution. The price on the bag was a little steep: $110. But thats a small price to pay for a easy to carry backpack that provides adequate padding. For the first couple months the bag worked great…

Continue Reading

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 = 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!(//, '&') 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

Macromedia Components & Object.prototype Don’t Get Along

In most of my flash projects I have a prototype file I include into the project. It contains additions to core objects such as Object, MovieClip, etc. Well, today I found out that some Macromedia components (ComboBox was the one I was having trouble with) don’t like additional methods to be defined on certain classes (Object was the one I found that ComboBox was having issues with); they fail to continue to work with additional methods defined. However, there is a workaround: ASSetPropFlags. Simply hide all additional methods with this line of code: [code lang=”actionscript”]ASSetPropFlags(Object.prototype, null, 1);[/code] I can’t wait until AS3 can be used all the time.

Continue Reading

Flash: Create MovieClip With Custom Class

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? createClassMovieClip:s [code lang=”actionscript”] /* 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…

Continue Reading

Flash & Fonts

I’ve written about the pains of fonts in flash before; and it something that still plauges my work today. However, since that post new tools have been created, new workflows introduced, and with that some new findings. Fonts With SWFMILL SWFMILL is an awesome tool that may allow you to leave the Flash IDE untouched for some projects. However, embedding fonts seems to be scarcely documented (I had trouble getting the methods documented working). Here are the two links I’ve found that document embedding fonts with swmill: Adding fonts to your SWF with FAMES Using SWFMILL I wasn’t able to get embedded fonts working using the information above, so here is my method. This is what my swfmill xml looks like…

Continue Reading

AttachMovie & Loaded Clips

Using attachMovie when you’ve loaded other clips into your movie has always been very painful. You can’t attachMovie a asset into a loaded clip that is located in the parent movieclip, and conversly you can’t attachMovie a asset in a parent that was loaded into a child. This is extremely frusterating… but after some searching today I came across this interesting link. Using the fact that Flash likes to cache everything it can, he created a function that will load an clip that contains an asset into the movieclip you are trying to use attachMovie from. Nice idea, never thought of doing this before…

Continue Reading

Jump To A HTML Anchor in a WebView

This isn’t something that is as straightfoward as you would think. There is no real ‘cocoa native’ way to acomplish this, and there seemed to be no information anywhere on how to acomplish this until I found this post. So it seems the only way to scroll to an anchor is to resort to evaluating javascript code: [code lang=”javascript”] – (void) jumpToAnchor:(NSString *)anchor { [oWebView stringByEvaluatingJavaScriptFromString:[NSString stringWithFormat:@”var anchor = document.anchors[“%@”];window.scrollTo(anchor.offsetLeft, anchor.offsetTop);”, anchor]]; } [/code]

Continue Reading