Quake3’s Fast InvSqrt()

via beyond3d

textorize-server — Easy textorize images via HTML image tags in PHP

textorize-server allows you to build textorize images via simple HTML image tags. textorize creates crisp subpixel rendered text images via RubyCocoa in the command-line. textorize is an awesome bit of software but it can be a pain to generate all the images you need. textorize-server makes it super easy.

Here’s how to use it

<img src="/textorize-server/img.php?m=just_a_test&f=arial&s=20&c=000000&g=ffffff" 
alt="just_a_test">

Just add a simple IMG tag in your HTML and textorize-server will give you this beautifully subpixel-rendered bit of text:

textorize-server test image

Installation
To run textorize-server, you’ll need to install textorize on your Mac like so:

$> gem sources -a http://gems.github.com
$> sudo gem install madrobby-textorize

Then clone textorize-server into your project’s docroot like so:

$> cd <your project's web root>
$> git clone git://github.com/thrashr888/textorize-server.git textorize-server
$> chmod 777 textorize/cache

textorize-server is hosted at GitHub (http://github.com/thrashr888/textorize-server). There you’ll find more thorough documentation about textorize-server.

Anatomy — An HTML Framework

Anatomy is an HTML glue framework that gives you basic HTML, JavaScript and CSS to get a new website going. Anatomy is built for designers that may not yet know the best way to build an HTML layout, as well as developers that are constantly starting new projects. Anatomy includes the most popular JS and CSS frameworks so can just pick one and get started.

Getting started is easy

  1. download the files
  2. remove the unused frameworks
  3. start adding your content.

Anatomy features include

  • XHTML 1.0 Transitional or HTML5 (experimental)
  • Smart defaults including jQuery, 960 and Google Ajax API
  • Layout basics: header with nav bar, content and footer DIVs as well as 2 and 3 column layouts
  • CSS Frameworks (960, Blueprint, YUI, meyerweb reset, Dropdown Menu)
  • JS Frameworks (jQuery, Prototype + Scriptaculous, MooTools, Dojo, YUI, Ext)
  • Google Analytics tags
  • Text to be replaced is marked by “REPLACE”

Installation

To use Anatomy, you can download Anatomy at GitHub or clone the repo like so:

$> git clone git://github.com/thrashr888/Anatomy.git

Anatomy HTML Framework is hosted at GitHub (http://github.com/thrashr888/Anatomy). There you’ll find more thorough documentation about Anatomy.

Asset Compression with YUI Compressor, Minify and OptiPNG

One of the best ways to speed up rendering of your website is to compress all your assets: JavaScript, CSS and images. Yahoo! has all but perfected this. The best way of compressing these files is using Yahoo!’s YUI Compressor. Here’s how.

Get the YUI Compressor

YUI Compressor can be found at Yahoo! here:

Once downloaded, you can run the compressor via command-line. Java is required.

$ java -jar yuicompressor-x.y.z.jar
$ java -jar yuicompressor-x.y.z.jar myfile.js -o myfile-min.js

The YUI Compressor Ruby Gem

You can also use a ruby gem to install and run the compressor. Compressing files is a little more difficult, check the documentation to learn how.

http://github.com/sstephenson/ruby-yui-compressor/tree/master

$ sudo gem install -r yui-compressor
$ irb -rubygems
>> require "yui/compressor"
compressor = YUI::JavaScriptCompressor.new
compressor.compress('var JS = "goes here";')

There are a few options for compressing and serving assets on the fly. Gzip compression via Apache is common and usually turned on by default on your server. In addition to that, I use Minify. It takes some time to setup but it’s worth it.

Minify PHP

The documentation is pretty clear, so I won’t copy it here. Either way, you’ve got smaller files. Running the command manually gives you a lot more control over how it works and where the files end up. But setting up a Minify “server” lets you compress all your files without worrying about missing anything. They both work great.

Image Compression with OptiPNG

Recently we’ve started compressing our images as well. Images are probably the most common asset format found on your webpage so it’s important to get them downloaded smoothly. I haven’t found a great tool for this yet but once again, Yahoo! provides. These tools provide lossless compression, which means you won’t see any visual difference in the file, only in the final file size. Most of the tools I’ve found work best on png files, which is a great format to work with since it provides 24 bit alpha channels (better transparency) unlike gif or jpgs.

  • Yahoo! Smush-It: http://developer.yahoo.com/yslow/smushit/
    Smush it does not yet have a public tool or API, but they’re working on it. It does a great job on png files. To compress the files, you have to place them on the internet and give the tool the urls. A better workaround is to use the tool via YSlow in Firebug.
  • OptiPNG: http://optipng.sourceforge.net/
    OptiPNG has great compression, a command-line tool and a GUI wrapper for OS X. The only downside is that it only works on png files. The GUI wrapper gives you a drag and drop tool for compressing your files.

How have you been compressing your files?

Injecting error messages into Symfony 1.1 Forms

Symfony 1.1 does a great job handling forms and form validation but say you have a few external forces checking the validity of the user submitted data, such as Paypal. Paypal would love to return it’s own error messages (thank you very much!) and tie it to a particular form field (say, the credit_card field).

Place this method into symfony_project/lib/form/BaseFormPropel.class.php

And use it like so:

You can find more of my Symfony snippets on GitHub.

My Portfolio on Flickr

My Portfolio Pieces on Flickr

Frosti

Bjork – Frosti
I made this.

Legendary Fist

Legendary Fist – my Chinese martial arts comedy – On YouTube

Music Video: Aphex Twin – COCK /Ver 2

Music Video: Aphex Twin – COCK /Ver 2 on YouTube.

My own notes here.