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
| ## Commandline for GM, a GIF resize in 3 steps | |
| # Analyze the GIF frames | |
| gm identify -format "File_size: %b, Unique_colors: %k, Bit_depth: %q, Orig Dimensions: %hx%wpx\n" original.gif | |
| # Apply a coalesce with correct colors and depth (from identify) and no dither (has to come in front to work) | |
| gm convert original.gif +dither -depth 8 -colors 135 -coalesce gm_resize_new_big.gif | |
| # Okay resize now and make sure it won't try to dither again! | |
| gm convert gm_resize_new_big.gif +dither -resize 100x100 gm_resize_new_small.gif |
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
| // this is the least sucky way i could think of to | |
| // detect and deal with a cross-browser impl of the page visibility api | |
| // forks welcome. | |
| function getHiddenProp(){ | |
| var prefixes = ['webkit','moz','ms','o']; | |
| if ('hidden' in document) return 'hidden'; | |
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
| // ---------------------------------------------------------- | |
| // A short snippet for detecting versions of IE in JavaScript | |
| // without resorting to user-agent sniffing | |
| // ---------------------------------------------------------- | |
| // If you're not in IE (or IE version is less than 5) then: | |
| // ie === undefined | |
| // If you're in IE (>=5) then you can determine which version: | |
| // ie === 7; // IE7 | |
| // Thus, to detect IE: | |
| // if (ie) {} |