Skip to content

Instantly share code, notes, and snippets.

View italoveloso's full-sized avatar

Italo Veloso italoveloso

  • Brasil
View GitHub Profile
@italoveloso
italoveloso / gist:3608674
Created September 3, 2012 11:28 — forked from lucasfais/gist:1207002
Sublime Text 2 - Useful Shortcuts

Sublime Text 2 – Useful Shortcuts (Mac OS X)

General

⌘T go to file
⌘⌃P go to project
⌘R go to methods
⌃G go to line
⌘KB toggle side bar
⌘⇧P command prompt
@italoveloso
italoveloso / velocity_2012.txt
Created October 5, 2012 20:10
Velocity 2012 notes
These reviews are very biased and reflect mostly my personal
preferences against the presented subjects.
Keynote videos are available at: http://velocityconf.com/velocity2012/public/schedule/proceedings
Breaking the mobile web (score: 2/5)
=======================
Estelle Weyl

PHP Prático: Streams

A palavra stream significa corrente. Em geral, qualquer conexão de rede é uma stream, e existem vários tipos de protocolos para streams. Esses protocolos definem como os dados fluem na corrente.

No PHP, vários protocolos são suportados de forma transparente:

<?php
Escrevo para compartilhar informações sobre o curso de Certificação ScrumMaster (CSM) que será realizado em TERESINA nos dias 01 e 02 de ABRIL.
Quem puder compartilhar com amigos e interessados, agradeço fortemente.
As inscrições já podem ser realizadas em www.goagil.com.br/inscricoes.php
Cordialmente,
Rodrigo Cursino
(81) 8849-1273
@italoveloso
italoveloso / gist:5098754
Created March 6, 2013 11:39
Scroll sem script
$(document).ready(function() {
$('html,body').animate({scrollTop: $("#dataTable").offset().top},'slow');
});
@italoveloso
italoveloso / gist:5172688
Created March 15, 2013 19:59
Enviar por e-mail simples e prático.
$('#enviaremail').on('click',function (e) {
var link = 'mailto:?body='+document.URL+'&subject='+document.title;
window.open(link, 'Enviar notícia por e-mail', 'width=600,height=600');
e.preventDefault();
});
#!/usr/bin/env php
# This function prints the difference between two php datetime objects
# in a more human readable form
# inputs should be like strtotime($date)
# Adapted from https://gist.github.com/207624 python version
function humanizeDateDiffference($now,$otherDate=null,$offset=null){
if($otherDate != null){
$offset = $now - $otherDate;
}

Awesome PHP Libraries

A list of amazingly awesome PHP libraries that you should consider using (and some other shiny extras).

if (window != top) top.location.href = location.href;
var id = 0;
var maxid = 0;
var zoom = false;
function addEvent(obj, method, func) {
if (obj.addEventListener) {
obj.addEventListener(method, func, false)
} else if (obj.attachEvent) {
if (!obj.events_size) obj.events_size = 0;
@italoveloso
italoveloso / MySQL function for replacing HTML entities with their actual characters
Created April 25, 2013 14:54
MySQL function for replacing HTML entities with their actual characters
DELIMITER $$
DROP FUNCTION IF EXISTS `database`.`HTML_UnEncode`$$
CREATE DEFINER=`root`@`127.0.0.1` FUNCTION `HTML_UnEncode`(x VARCHAR(255)) RETURNS varchar(255) CHARSET latin1
BEGIN
DECLARE TextString VARCHAR(255) ;
SET TextString = x ;
#quotation mark