Skip to content

Instantly share code, notes, and snippets.

View jorgeguberte's full-sized avatar
🥁

Jorge Guberte jorgeguberte

🥁
View GitHub Profile
@jorgeguberte
jorgeguberte / gist:1270672
Created October 7, 2011 16:06
date_diff php workaround
/*
* DateTime::diff on PHP has a bug on Windows systems where it always outputs 6015. Here's a workaround]
* that i found on http://acme-tech.net/blog/2010/10/12/php-datetimediff-returns-6015/
*/
function dateDiff($dt1, $dt2, $timeZone = 'GMT') {
$tZone = new DateTimeZone($timeZone);
$dt1 = new DateTime($dt1, $tZone);
$dt2 = new DateTime($dt2, $tZone);
$ts1 = $dt1->format('Y-m-d');
@jorgeguberte
jorgeguberte / nodeInstallUbuntu
Created October 1, 2011 14:53 — forked from barroso/nodeInstallUbuntu
Instalação nodejs no ubuntu
#caso não tenha
sudo apt-get install git
sudo apt-get install curl python libssl-dev
mkdir ~/nodejs/
cd ~/nodejs/
git clone git://github.com/joyent/node.git
var simpleTitle = "Google+";
var titleWithCount = "(5) Google+";
var titleWithName = "Jorge Guberte - Google+";
var complexTitle = "(5) Jorge Guberte - Google+";
getTrimmedTitle = function(){
var title = $("title").text();
if(parseInt(title.indexOf(')'))>0){
return title.slice(4);
}else{
<!doctype>
<html>
<head>
<title>Searchbox</title>
</head>
<body>
<style>
#outerContainer{
width: 350px;
@jorgeguberte
jorgeguberte / helloworld.js
Created July 4, 2011 02:57
Testando o gist do github
alert("Hello world!");