Skip to content

Instantly share code, notes, and snippets.

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

Dan Jesus danjesus

🏠
Working from home
View GitHub Profile
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />
<title>PHP com Jquery e Json</title>
<style type="text/css">
.product {
float:left;
background:#ccc;
@danjesus
danjesus / Google maps Mashup.html
Created March 3, 2011 20:20
Gooogle Maps Mashup on Lqdi
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8"/>
<title>Google Directions Mashup On LQDI Design & Interação :: @dannjesus </title>
<link href="http://code.google.com/apis/maps/documentation/javascript/examples/standard.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.5.1/jquery.min.js"></script>
<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script>
<style type="text/css">
@danjesus
danjesus / compartilhe.html
Created May 13, 2011 17:10
Exemplo de compartilhe no facebook e no twitter
<!-- Marcação HTML-->
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:og="http://ogp.me/ns#" xmlns:fb="http://www.facebook.com/2008/fbml" xml:lang="pt-br" lang="pt-br">
<!--// marcação HTML -->
<!-- Tags acionais Open Graph e Facebook -->
<meta property="og:title" content="Titulo da página"/>
<meta property="og:type" content="article"/>
@danjesus
danjesus / Defaul.sublime.keymap-partial
Created June 20, 2011 13:54
Ativar zen-coding no sublime text editor
<binding key="ctrl+e" command="zenExpand" uuid="59b1aa71-38c6-11df-af16-00037af1a101">
<context name="selector" value="(text.html || text.xml) - source"/>
</binding>
<binding key="ctrl+e" command="zenExpand" uuid="59b1aa71-38c6-11df-af16-00037af1a101">
<context name="selector" value="source.css" />
</binding>
@danjesus
danjesus / gist:1081141
Created July 13, 2011 19:31
TouchMove IPAD
document.getElementById("seletor").addEventListener('touchmove', function(e) {
//Add events here
}, false);
@danjesus
danjesus / Resize.php
Created August 5, 2011 15:00
Crop Images Method
<?php
# ========================================================================#
#
# Author: Jarrod Oberto
# Version: 1.0
# Date: 17-Jan-10
# Purpose: Resizes and saves image
# Requires : Requires PHP5, GD library.
# Usage Example:
@danjesus
danjesus / quickconnect.php
Created August 10, 2011 20:12
Quick Connection Solve Problem Diesel Framework
public static function QuickConnect($server) {
return LDB::Connect($server['hostname'], $server['username'], $server['password'], $server['database'], $server['port'], $server['table_prefix'], $server['auto_switch'], $server['persistent'], $server['driver']);
}
@danjesus
danjesus / validation.php
Created August 22, 2011 15:12
Diesel Framework 1.0 - Add login to controller
public function login() {
if ($_SESSION['csrfToken'] == $_POST['isValid']) {
$username = clear($_POST['username']);
$password = User::generateHash($_POST['password']);
$user = LDB::GetSingleByProperty("users", array('username' => $username));
if (!$user) {
redirect("admin/dashboard/index/login_failed");
} else if ($user['password'] !== $password) {
@danjesus
danjesus / agenda.php
Created August 23, 2011 19:12
Ler arquivo XML com php
<?php
/**
* load XML file
* LIMIT 4 lines
*/
$eventos = simplexml_load_file("agenda.xml");
$count = 0;
?>
@danjesus
danjesus / sendmail.php
Created August 25, 2011 15:07
Send Mail PHP with PHPMAILER CLASS - Example
<?php
if($_POST){
//header("Content-Type: text/html; charset=ISO-8859-1",true);
include_once('PHPMailer.php');
include_once('class.smtp.php');
include_once('_lightToolkit/libs.php'); // Change this line