Skip to content

Instantly share code, notes, and snippets.

@rxaviers
Created January 21, 2013 14:29
Show Gist options
  • Select an option

  • Save rxaviers/4586450 to your computer and use it in GitHub Desktop.

Select an option

Save rxaviers/4586450 to your computer and use it in GitHub Desktop.
#! /usr/bin/node
require('nodetime').profile();
var match, params,
async = require( "async" ),
bunchOfGenerates = [],
filename = "ui-icons_999999_256x240.png",
ThemeRoller = require( "./lib/themeroller" );
// ui-icons_<color>_256x240.png
match = filename.match( /^ui-icons_(\w+)_256x240.png$/i );
if ( match == null ) {
throw new Error( "Invalid format: " + filename );
}
params = {
color: match[ 1 ]
};
function generate( callback ) {
ThemeRoller.generateIcon( params, function( err, data ) {
callback( err );
});
}
for( var i=0; i<10000; i++ ) {
bunchOfGenerates.push( generate );
}
async.series( bunchOfGenerates, function( err, results ) {
if ( err ) {
process.exit( 1 );
}
else {
process.exit( 0 );
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment