Skip to content

Instantly share code, notes, and snippets.

View jorgeguberte's full-sized avatar
🥁

Jorge Guberte jorgeguberte

🥁
View GitHub Profile
var Societ = function(inboundConfig){
this.population = undefined;
this.owner_id = undefined;
this.owner_name = undefined;
this.config = inboundConfig;
this.aspects = {
education:{
facilities: undefined,
rating: undefined
/*
Societ.prototype.aspects = {
education: {
},
health: {
}
}
Societ.prototype.tick = function(){
@jorgeguberte
jorgeguberte / gist:5091420
Created March 5, 2013 16:10
Exercício de envio de formulário via Ajax com jQuery/Javascript
<!doctype html>
<html>
<head>
<style>
body{
margin: 0;
padding: 0;
}
label, input{
float: left;
function fnFilterColumn ( i )
{
$('#example').dataTable().fnFilter(
$('#ml_searchInput').val(),
0,
false, false
/*$("#col"+(i+1)+"_regex")[0].checked,
$("#col"+(i+1)+"_smart")[0].checked*/
);
} //$("#tableExample").dataTable();
@jorgeguberte
jorgeguberte / gist:4964952
Created February 16, 2013 01:09
Visualizador de divs
$('div').css('border','solid 1px red');
//Source: http://stackoverflow.com/a/476681
function preload(arrayOfImages) {
$(arrayOfImages).each(function(){
$('<img/>')[0].src = this;
// Alternatively you could use:
// (new Image()).src = this;
});
}
@jorgeguberte
jorgeguberte / gist:4169357
Created November 29, 2012 14:13
CSS3 Transitions fallback checker (Javascript)
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;
/*
* 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;
@jorgeguberte
jorgeguberte / gist:1443051
Created December 7, 2011 14:43
Download album from Picasa with Python
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')
@jorgeguberte
jorgeguberte / gist:1275767
Created October 10, 2011 16:45
Cálculo de diferença de dias javascript
//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));