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 | |
| error_reporting(E_ALL ^ E_NOTICE); | |
| ini_set("display_errors", 1); | |
| // Without the line below, the time comes in UTC. | |
| // date_default_timezone_set('America/Sao_Paulo'); | |
| function query_ntp_server ($timeserver) { | |
| try { | |
| $socket = fsockopen("udp://$timeserver", 123, $err_no, $err_str, 1); |
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
| #!/bin/sh | |
| # Adriano Laranjeira (@arglbr) | |
| # Based on: | |
| # http://jonrohan.me/guide/git/dead-simple-git-workflow-for-agile-teams/ | |
| # Language: PT-BR | |
| # | |
| nocGitHelp(){ | |
| echo "Uso: nocgit [ARG] [BRANCH]" | |
| echo "Cria nova branch, atualiza a source tree local, envia as" |
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
| #!/bin/bash | |
| # | |
| # If this works for you, UPDATE YOUR MYSQL ASAP!! | |
| for i in `seq 1 1000`; | |
| do mysql -u root --password=xxxxx -h mysql_host 2>/dev/null; | |
| 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
| #!/bin/bash | |
| # How to use it: | |
| # mkv2avi file.mkv file.avi | |
| # Obviously the script must be executable. | |
| # | |
| mencoder $1 -ovc lavc -lavcopts vcodec=mpeg4:threads=8:vbitrate=3000 -oac pcm -o /tmp/tmp01.avi | |
| ffmpeg -i /tmp/tmp01.avi -vcodec copy -vtag xvid -acodec copy $2 | |
| rm -fv /tmp/tmp01.avi |
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
| #!/bin/bash | |
| for i in `seq 0 6`; | |
| do echo "Extrating $i..." | |
| convert comprovante.png -crop 383x385+0+`echo $i*385 | bc` comp$i.png; | |
| 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
| <?php | |
| // Is it readable? | |
| $wait = ($wait = array_shift($itens['wait'])) ? "<div id=\"wait\" class=\"t1\">$wait</div>" : null; |
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 | |
| require_once "HTTP/Request2.php"; | |
| /* | |
| . | |
| . | |
| . | |
| */ | |
| $req = new \HTTP_Request2('https://browserid.org/verify', \HTTP_Request2::METHOD_POST, array('ssl_verify_peer' => false,)); | |
| $req->setAdapter('curl'); |
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 | |
| class Gravatar { | |
| const HTTP_URL = 'http://www.'; | |
| const HTTPS_URL = 'https://secure.'; | |
| const BASE_URL = 'gravatar.com/'; | |
| const AVATAR_URL = 'avatar/'; | |
| private $email_address; | |
| private function setHash() { | |
| return md5(strtolower(trim($this->email_address))); |
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 | |
| print <<<MSG | |
| Testing the awesome Gist.vim plugin at... VIM!! | |
| It can be get at: http://www.vim.org/scripts/script.php?script_id=2423 | |
| ;-) | |
| -- |
NewerOlder