This file contains 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 | |
/* | |
Let’s say we are dealing with sending data over the internet, to make it simple, assume this plain text, in order to save some bandwidth we want to compress it, according to the following function: | |
compress(aaaaca) -> ax4ca | |
compress(aaaaaabbbcaaa) -> ax6bx3cax3 | |
compress(mississippi) -> misx2isx2ipx2i | |
*/ |
This file contains 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
##### | |
# | |
# Example .htaccess file for TYPO3 CMS - for use with Apache Webserver | |
# | |
# This file includes settings for the following configuration options: | |
# | |
# - Compression | |
# - Caching | |
# - MIME types | |
# - Cross Origin requests |
This file contains 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 myFunction() { | |
var str = "a Raposa Matou o rato no NatO"; | |
var res = str.toLowerCase().split(" "); | |
var htmlFinal = ""; | |
for(let i = 0; i < res.length; i++){ | |
palavra = res[i].split(""); | |
for(let i2 = 0; i2 < palavra.length; i2++){ | |
console.log(palavra[i2]); | |
} | |
} |
This file contains 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 | |
// A função abaixo demonstra o uso de uma expressão regular que identifica, de forma simples, telefones válidos no Brasil. | |
// Nenhum DDD iniciado por 0 é aceito, e nenhum número de telefone pode iniciar com 0 ou 1. | |
// Exemplos válidos: +55 (11) 98888-8888 / 9999-9999 / 21 98888-8888 / 5511988888888 | |
function phoneValidate($phone) | |
{ | |
$regex = '/^(?:(?:\+|00)?(55)\s?)?(?:\(?([1-9][0-9])\)?\s?)?(?:((?:9\d|[2-9])\d{3})\-?(\d{4}))$/'; | |
if (preg_match($regex, $phone) == false) { |
This file contains 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 | |
$handle = fopen ("php://stdin", "r"); | |
function equalizeArray($arr) { | |
$diff = 0; | |
$d = []; | |
foreach($arr as $item) { | |
@$d[$item]++; | |
} | |
This file contains 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 | |
/** | |
* Trait to handle commom function used by DynamicController or anything that needs to access or run query in any Database | |
*/ | |
namespace App\Traits; | |
use Config; | |
use Db; |
This file contains 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 | |
namespace App\Http\Requests; | |
use App\Http\Requests\Request; | |
use Illuminate\Contracts\Validation\Validator; | |
class AbstractRequest extends Request | |
{ | |
This file contains 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
$jsString = ob_get_contents(); | |
ob_end_clean(); | |
$unescaped = array("'", '"'); | |
$escaped = array("\\x27", "\\x22"); | |
echo str_replace($unescaped, $escaped, $jsString); |
This file contains 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 validateEmail(email) { | |
var re = /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/; | |
return re.test(email); | |
} | |
emailCaptured = false; | |
(function($) { | |
$("input[type='text']").on('keyup', function (e) { |
This file contains 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
I use the first | |
—– BEGIN LICENSE —– | |
Michael Barnes | |
Single User License | |
EA7E-821385 | |
8A353C41 872A0D5C DF9B2950 AFF6F667 | |
C458EA6D 8EA3C286 98D1D650 131A97AB | |
AA919AEC EF20E143 B361B1E7 4C8B7F04 |
NewerOlder