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 limpastring($palavra) | |
| { | |
| //$palavra = "açúcar união"; | |
| $palavra = strtolower(ereg_replace("[^a-zA-Z0-9_.]", | |
| "", strtr($nome_antigo, "áàãâéêíóôõúüçÁÀÃÂÉÊÍÓÔÕÚÜÇ ", | |
| "aaaaeeiooouucAAAAEEIOOOUUC_"))); | |
| return $palavra; // imprime "acucar_uniao" | |
| } |
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
| <pre><?php | |
| $var = "Not%c3%adcias"; | |
| echo $var; | |
| echo "\n"; | |
| echo htmlentities($var); | |
| echo "\n"; | |
| echo urlencode($var); | |
| echo "\n"; |
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
| ffmpeg -i input.m4downgrade svn -acodec libmp3lame -ab 128k output.mp3 | |
| #!/bin/bash | |
| for i in *.mp4 | |
| do | |
| ffmpeg -i "$i" -ab 128k "${i%mp4}mp3" | |
| done |
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
| if (typeof window.event != 'undefined') // IE | |
| document.onkeydown = function() // IE | |
| { | |
| var t=event.srcElement.type; | |
| var kc=event.keyCode; | |
| return ((kc != 8 && kc != 13) || ( t == 'text' && kc != 13 ) || | |
| (t == 'textarea') || ( t == 'submit' && kc == 13)) | |
| } | |
| else | |
| document.onkeypress = function(e) // FireFox/Others |
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
| Para apenas uma release | |
| svn diff -c 442 | cut -c 9- | xargs zip -9 patch_hoje.zip | |
| Para um range de releases | |
| svn diff -r 419:442 --summarize | cut -c 9- | xargs zip -9 patch.zip |
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
| svn propset svn:ignore "*" var/log/ | |
| Pode ser usado a opção --recursive |
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 echo $this->getLayout()->createBlock('cms/block')->setBlockId('identifier')->toHtml() ?> |
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 getUtm(){ | |
| $utm = array(); | |
| if(!empty($_COOKIE['__utmz'])){ | |
| $pattern = "/(utmcsr=([^\|]*)[\|]?)|(utmccn=([^\|]*)[\|]?)|(utmcmd=([^\|]*)[\|]?)|(utmctr=([^\|]*)[\|]?)|(utmcct=([^\|]*)[\|]?)/i"; | |
| preg_match_all($pattern, $_COOKIE['__utmz'], $matches); | |
| if(!empty($matches[0])){ | |
| foreach($matches[0] as $match){ | |
| $pair = null; | |
| $match = trim($match, "|"); | |
| list($k, $v) = explode("=", $match); |
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
| $postcode = new Mage_Checkout_Block_Cart_Shipping; | |
| $zip_code = $postcode->getEstimatePostcode(); |
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
| diff -qrbB default_sacred_core_folder clients_core_folder | |
| # q = report only differ | |
| # r = recursive | |
| # ignore change in the amount of white space | |
| # ignore changes whose lines are all blank |