Skip to content

Instantly share code, notes, and snippets.

View tadeubdev's full-sized avatar
🎯
Focusing

Tadeu Barbosa tadeubdev

🎯
Focusing
  • Espírito Santo, Brasil
View GitHub Profile
<?php
class Cart
{
public $CookieName = 'carrinho';
public function __construct() {
if(!$this->getCookie()) {
return;
}
<?php
### --- Snip --- ###
App::after(function($request, $response)
{
// HTML Minification
if(App::Environment() != 'local')
{
if($response instanceof Illuminate\Http\Response)
<?php
function renderPhpFile($filename, $vars = null)
{
if (is_array($vars) && !empty($vars))
{
extract($vars);
}
ob_start();
include $filename;
@tadeubdev
tadeubdev / time-in-seconds.js
Last active August 29, 2015 14:05
Utilizo essa função quando preciso retornar o time do JScript e calcular em segundos.
// Retorna o `Date.getTime()` removendo os milisegundos.
time = function()
{
return new Date().getTime().toString().substring(0,10);
};
// Ex.:
setInterval(function()
{
@tadeubdev
tadeubdev / string-repeat.js
Created August 19, 2014 17:50
Esta função repete uma string a quantidade de vezes requisitada e a retorna
// Repete uma `string` a quantidade de vezes requisitada.
String.prototype.repeat = function( num )
{
return new Array( num + 1 ).join( this );
}
// Ex.:
@tadeubdev
tadeubdev / random.js
Last active August 29, 2015 14:05
Esta função retorna um número randomico com o tamanho requisitado
// Esta função retorna um número randomico com o tamanho requisitado
// `rep` deve ser um valor inteiro e deve ser no máximo 15
random = function ( rep )
{
if( 15 > rep )
{
// Para saber mais siga até: http://tadeubarbosa.github.io/audio-somente-em-aba-mestre/
///////
// Funções simples mas que ajudam bastante neste projeto
// Time: Gist > https://gist.github.com/tadeubarbosa/969a249e68e3ac55f341
time = function(){return new Date().getTime().toString().substring(0,10);};
// Repeat : Gist > https://gist.github.com/tadeubarbosa/57ba0b9cab817afef487
{
"estados": [
{
"sigla": "AC",
"nome": "Acre",
"cidades": [
"Acrelândia",
"Assis Brasil",
"Brasiléia",
"Bujari",
@tadeubdev
tadeubdev / Html.php
Created March 11, 2015 21:14
Html Class PHP: Html::span("It's a test!") // prints: <span>It's a test!</span>
<?php
class Html
{
public static $content;
public static $name;
public static $attrs = [];
<?php
/**
* -------------------------------------------
* A class to compile teedcss into projects
* -------------------------------------------
* Creator: Tadeu Barbosa
* Inits in: > August.03.2016 - 06:30h PM <
*
**/