Erik's blog

Code, notes, recipes, general musings

Archive for June 2011

Notes from “Web Application Development with Closure Compiler” talk by Alan Leung on 6/22/11

leave a comment »

Alan visited Twitter on 6/22 and presented an introductory talk on Google’s Closure compiler for JavaScript. Alan is tech lead on Closure team.

Here are the slides:


* JavaScript was originally designed for small DOM operations. Now that we’re building large-scale apps in JS, we can use some help.
* Google uses Closure for all but a couple products
* The Closure compiler can perform ~55 optimization passes, including linting code, validating function definitions, performing gzip-optimized compression, trimming dead branches
* Closure can also provide compile-time constants, e.g., “if(INTERNAL){…”, and trim unused branches that result
* Closure uses a graph coloring heuristic for variable renaming



Written by Erik

June 25, 2011 at 11:43 am

A nice button

leave a comment »

input[type=submit] {

  font-size: inherit;

  padding: 0.5ex 1ex;
  margin: 0;

  border: 1px solid #ccc;

  /* */
  -webkit-border-radius: 4px;
  -moz-border-radius: 4px;
  border-radius: 4px;

  /* */
  background: #ffffff; /* Old browsers */
  background: -moz-linear-gradient(top, #ffffff 0%, #cccccc 100%); /* FF3.6+ */
  background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#ffffff), color-stop(100%,#cccccc)); /* Chrome,Safari4+ */
  background: -webkit-linear-gradient(top, #ffffff 0%,#cccccc 100%); /* Chrome10+,Safari5.1+ */
  background: -o-linear-gradient(top, #ffffff 0%,#cccccc 100%); /* Opera11.10+ */
  background: -ms-linear-gradient(top, #ffffff 0%,#cccccc 100%); /* IE10+ */
  filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#ffffff', endColorstr='#cccccc',GradientType=0 ); /* IE6-9 */
  background: linear-gradient(top, #ffffff 0%,#cccccc 100%); /* W3C */

Written by Erik

June 5, 2011 at 1:10 am

Posted in code

Tagged with