This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
alert("Hello world!"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!doctype> | |
<html> | |
<head> | |
<title>Searchbox</title> | |
</head> | |
<body> | |
<style> | |
#outerContainer{ | |
width: 350px; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* 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'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Substituir por valores reais. | |
var data1 = new Date('YYYY', 'MM','DD'); | |
var data2 = new Date('YYYY', 'MM','DD'); | |
var diferenca = parseInt((data1-data2)/(24*3600*1000)); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import urllib | |
from xml.dom import minidom | |
''' | |
Opens an xml and parse it | |
Could fetch the xml from Picasa instead of fetching from the disk. | |
''' | |
print 'Fetching xml...' | |
sock = open('xml.xml') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Theme name: SpressoSP Mobile | |
* Theme URI: http://www.spressosp.com.br | |
* Description: Tema versão mobile do SPressoSP | |
* Author: Publisher Brasil | |
* Author URI: http://publisherbrasil.com.br | |
*/ | |
img{ | |
max-width: 440px; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function cssTransitions() { | |
m = document.createElement('z'); | |
s = m.style; | |
function test_props( p ) { | |
for ( var i in p ) { | |
if ( s[ p[i] ] ) { | |
return true; | |
} | |
} | |
return false; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Source: http://stackoverflow.com/a/476681 | |
function preload(arrayOfImages) { | |
$(arrayOfImages).each(function(){ | |
$('<img/>')[0].src = this; | |
// Alternatively you could use: | |
// (new Image()).src = this; | |
}); | |
} |
OlderNewer