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 | |
/** | |
* @author Wallace de Souza Vizerra <[email protected]> | |
* @version 1.0 | |
* @see hehehehehe | |
**/ | |
final class FixedString implements ArrayAccess | |
{ |
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 url_parse (href, name) { | |
var a = document.createElement('a'); | |
a.href = href; | |
if (name) return a[name]; | |
return { | |
host: a.hostname, |
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 | |
/** | |
* Forçando números com 8 dígitos, separando os números por um hifen de 4 em 4 | |
**/ | |
$card_1 = 1234567; | |
$card_2 = 12345678; | |
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 format_money(number) | |
{ | |
return (number).toFixed(2).replace('.', ','); | |
} |
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 | |
$numero = '0.12.13'; | |
preg_replace('/\D+/', '', $numero); // string('01213') | |
preg_replace('~\D+~', '', $numero); // string('01213') | |
preg_replace('#\D+#', '', $numero); // string('01213') |
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
SET SESSION group_concat_max_len = 100000000; | |
SELECT group_concat(matricula) FROM tabela; |
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 | |
/** | |
* Xrange for PHP | |
*/ | |
class XRange implements Iterator | |
{ | |
/** | |
* initial value for iteration | |
* @var int |
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 FileObject extends SplFileObject { | |
public function tail($amount) | |
{ | |
$lastKey = $this->key(); | |
$this->seek(PHP_INT_MAX); |
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.clickOut = function (callback) { | |
var that = this; | |
$(document).click(function (e) { | |
if ( $(e.target).closest(that).size() > 0) { |
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 | |
return array( | |
'profile' => true, | |
'fetch' => PDO::FETCH_CLASS, | |
'default' => 'mysql_gugu', |
OlderNewer