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
| /** | |
| * Image Sizes Manager | |
| * Paste into functions.php or add via Code Snippets. | |
| * Goes to Tools > Image Sizes in your WordPress admin. | |
| */ | |
| class Image_Sizes_Manager { | |
| /** Option key for persisting disabled size slugs. */ | |
| const OPTION_KEY = 'ism_disabled_sizes'; |
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/env phantomjs | |
| var system = require('system'); | |
| var text = encodeURIComponent(system.stdin.read()); | |
| var url = "http://translate.google.com/#auto/en/" + text; | |
| var page = require('webpage').create(); | |
| page.settings.userAgent = 'Mozilla/5.0 (X11; Ubuntu; Linux i686; rv:13.0) Gecko/20100101 Firefox/13.0'; | |
| page.onConsoleMessage = function (msg) { |
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
| <?php | |
| function progress_bar($done, $total, $info="", $width=50) { | |
| $perc = round(($done * 100) / $total); | |
| $bar = round(($width * $perc) / 100); | |
| return sprintf("%s%%[%s>%s]%s\r", $perc, str_repeat("=", $bar), str_repeat(" ", $width-$bar), $info); | |
| } |
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
| private void asyncTaskWithInlineCallback() { | |
| // display UI progress indicator | |
| // ... | |
| new MyAsyncTask() { | |
| protected void onPostExecute(Boolean result) { | |
| // dismiss UI progress indicator | |
| // process the result | |
| // ... | |
| } |