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 | |
| # ---------------------------------------------------------------------- | |
| # DFN Thumbnailer | |
| # http://www.digifuzz.net | |
| # [email protected] | |
| # ---------------------------------------------------------------------- | |
| # Constants | |
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 plural($num) { | |
| if ($num != 1) | |
| return "s"; | |
| } | |
| function getRelativeTime($date) { | |
| $diff = time() - strtotime($date); |
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 | |
| # first define colors to use | |
| $_colors = array( | |
| LIGHT_RED => "[1;31m", | |
| LIGHT_GREEN => "[1;32m", | |
| YELLOW => "[1;33m", | |
| LIGHT_BLUE => "[1;34m", | |
| MAGENTA => "[1;35m", | |
| LIGHT_CYAN => "[1;36m", | |
| WHITE => "[1;37m", |
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 limpa_array($array) { | |
| foreach($array as $arr) | |
| if($arr != '') | |
| $retorno[] = $arr; | |
| return $retorno; | |
| } |
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
| var win = Titanium.UI.currentWindow; | |
| var ind=Titanium.UI.createProgressBar({ | |
| width:200, | |
| height:50, | |
| min:0, | |
| max:1, | |
| value:0, | |
| style:Titanium.UI.iPhone.ProgressBarStyle.PLAIN, | |
| top:10, |
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 | |
| # ATENÇÃO - PARTE DESTE CÓDIGO NÃO FUNCIONA! | |
| # Hoje em dia temos | |
| if($cor == "Vermelho") | |
| echo "Faça algo"; | |
| endif; | |
| # e também | |
| switch($cor) |
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 | |
| /* | |
| * Tive um sonho muito estranho essa noite, | |
| * sonhei que estava escrevendo php desta forma abaixo | |
| * no meu sonho parecia algo meio ruby + php + python | |
| * | |
| * sei lá acho que estou com pânico de "{" | |
| */ |
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
| function get_remote_file(filename, url, fn_end, fn_progress ) { | |
| Ti.API.info("[filename]" + filename); | |
| Ti.API.info("[url]" + url); | |
| var file_obj = {file:filename, url:url, path: null}; | |
| var file = Titanium.Filesystem.getFile(Titanium.Filesystem.applicationDataDirectory,filename); | |
| if ( !file.exists() ) { |
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
| $(function() { | |
| $.fn.serialize = function (options) { | |
| return $.param(this.serializeArray(options)); | |
| }; | |
| $.fn.serializeArray = function (options) { | |
| var o = $.extend({ | |
| checkboxesAsBools: false | |
| }, options || {}); |
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
| function inspect(obj, maxLevels, level) | |
| { | |
| var str = '', type, msg; | |
| // Start Input Validations | |
| // Don't touch, we start iterating at level zero | |
| if(level == null) level = 0; | |
| // At least you want to show the first level | |
| if(maxLevels == null) maxLevels = 1; |