Free script to compress CSS/Javascript

The source code for that page is open source on github. Just look at how they did it. There is also Assetic which is a php lbrary that can be used to minify and compress assets. Though Assetic is probably slightly out of date way to do this.