Skip to content

Instantly share code, notes, and snippets.

View saleiva's full-sized avatar
🤓

Sergio Álvarez Leiva saleiva

🤓
View GitHub Profile
He dado las invitaciones a news.layervault en **explicito** orden cronológico
http://twitter.com/dsaltaren/status/289441866145996800
http://twitter.com/damagedgoods/status/289441977576079360
http://twitter.com/happywebcoder/status/289442291469393920
@saleiva
saleiva / gist:4492202
Last active December 10, 2015 20:59 — forked from anonymous/gist:4266841
var t;
var posicion=0;
var mi_array=new Array();
//numero de diapositivas
//n es el numero de parámetros.
function presentacion(n){
for(var i=0; i<=n; i++){
mi_array[i]=i;
}
var posicion= 0;
var mi_array= new Array();
function presentacion(n){ //numero de diapositivas//
for(var i=0; i<=n; i++){
mi_array[i] = i;
console.log('numeroDiapositivas');
}
}
@saleiva
saleiva / examen.js
Created December 19, 2012 10:37 — forked from f3rn8nd0/examen.js
var array = new Array();
console.log("Bienvenido a tu propio proyector de diapositivas");
console.log("INSTRUCCIONES DE USO");
console.log("Escribe: carrusel(el número de imágenes)");
console.log("Una vez introducido el número, utiliza siguiente() para avanzar");
console.log("y anterior() para retroceder");
console.log("¡Feliz visionado!");
var posicion = 0;
//Crear simulador numérico de presentaciones
var a = new Array();
var posicion = 0;
var n = 20;
var t;
// Crea una lista de diapositivas
function lista(_n){
n = _n;
for (i=0; i<= _n; i++){
var a = new Array();
var n;
var posicion = 0;
// Crear una función que, al enviarle el número de diapositivas (ej:15), devuelva un array ordenado con ej(15) diapositivas.
function crearPresentacion(n){
for (var i=0; i<=n; i++){
a[i]=i;
}
return "creado";
@saleiva
saleiva / gist:4112474
Created November 19, 2012 18:19
Cartocss conditional example
#your_table_name{
marker-fill: #FF5C00;
marker-opacity: 0.8;
marker-allow-overlap: true;
marker-placement: point;
marker-type: ellipse;
marker-width: 7;
marker-line-width: 2;
@saleiva
saleiva / rasters.sql
Created September 14, 2012 13:28 — forked from andrewxhill/rasters.sql
Rasters to polygons for CartoDB
--Upload your new raster data
--In my case the data goes into a table, night_light
--In some cases, I find it useful to downsample the total number of variables in a band, or in some cases merge data from multiple bands into one.
--Here is an example how one such process would work
UPDATE night_light SET rast = ST_MapAlgebraExpr(rast,'8BUI','CASE WHEN [rast] = 0 THEN 10 WHEN [rast] = 255 THEN 11 ELSE floor([rast]/32)::int END');
--Create a new table, light_polygons
--Add a numeric column called, rast_value
@saleiva
saleiva / gist:3438086
Created August 23, 2012 16:06 — 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
@saleiva
saleiva / gist:3010148
Created June 28, 2012 09:19
labels on carto
#{table_name}{
text-face-name: "DejaVu Sans Book";
text-fill:#000;
text-size:10;
text-halo-fill:rgba(255,255,255,1);
text-halo-radius:1;
text-line-spacing:1;
text-wrap-width:20;
text-opacity:.7;
text-allow-overlap:true;