Skip to content

Instantly share code, notes, and snippets.

View danjesus's full-sized avatar
🏠
Working from home

Dan danjesus

🏠
Working from home
View GitHub Profile
@danjesus
danjesus / gist:1205465
Created September 9, 2011 04:01
Singleton Pattern Javascript
var Cart = {
init: function(){
},
addItem: function(){
},
@danjesus
danjesus / gist:1206259
Created September 9, 2011 13:52
Why 10
//Method 1
console.log (++[[]][0]+[0]);
//Method 2
var zero = [0].toString();
console.log( 1 + zero );
//Method 3
console.log(++[[]][+[]] + [+[0]]);
@danjesus
danjesus / gist:1220013
Created September 15, 2011 18:12
Mime Type function
/**
* Obtém o MIME Type de um arquivo
*
* @param string $file O caminho do arquivo
* @return string O MIME type correspondente
*/
public static function getMIMEType($filename) {
$mime_types = array(
@danjesus
danjesus / Pager.php
Created September 16, 2011 19:04
Classe para paginação no Diesel
<?php
class Pager {
public $table;
public $path;
public $page;
public $per_page;
public $offset;
public $conditionals;
@danjesus
danjesus / LDB3.php
Created October 26, 2011 20:00 — forked from DfKimera/LDB3.php
<?php
/**
* Diesel Framework
* Copyright © LQDI Technologies - 2011
* http://www.lqdi.net
*
* Serviço de abstração do banco de dados
* Light Database Abstraction Layer
*
@danjesus
danjesus / EmailHelper.php
Created December 6, 2011 13:28
Diesel Email Helper
<?php
/**
* Classe reponsável pelo envio de e-mails na aplicação
*
*/
class EmailHelper {
/**
* Recebe as configurações de envio
@danjesus
danjesus / gist:1512097
Created December 22, 2011 22:19
Unix Like Systems Diesel
/**
* Tratamento das classes para unix like systems
* @var Class
* @author Dan Jesus
*/
$class = ucfirst($class);
$class_explode = explode('_', $class);
if(sizeof($class_explode) > 1){
@danjesus
danjesus / Session.php
Created January 11, 2012 13:12
Functions Diesel
<?php
/**
* Diesel Framework
* Copyright © LQDI Technologies - 2011
* http://www.lqdi.net
*
* Biblioteca de gerenciamento de sessão de usuário
*
* @author Aryel Tupinambá
@danjesus
danjesus / gist:2356041
Created April 11, 2012 00:59
Meta Tags
<meta name="rating" content="GENERAL"/>
<meta name="url" content="https://www.url.com.br"/>
<meta name="subject" content="Tipo do site"/>
<meta name="revisit-after" content="1 Days"/>
<meta name="robots" content="index,follow"/>
<meta name="googlebot" content="index,follow"/>
<meta name="audience" content="all"/>
<!-- SLIDE -->
<div class="destaques-slide" style="position:relative;">
<div style="margin:0 auto; width:978px; position:relative;">
<span style="position:absolute; left:0; top:35px;">
<a href="#" onclick="slideLeft(); return false;"><img src="images/set-esq-home.png" /></a>
</span>
<span style="position:absolute; right:0; top:35px;">
<a href="#" onclick="slideRight(); return false;"><img src="images/set-dir-home.png" /></a>
</span>
</div>