Created
January 21, 2013 14:29
-
-
Save rxaviers/4586450 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #! /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