Skip to content

Instantly share code, notes, and snippets.

View javierarce's full-sized avatar

Javier Arce javierarce

View GitHub Profile
SELECT count(cartodb_id) as ct, ST_Transform(ST_Buffer(ST_SnapToGrid(the_geom,0.002),0.001, ‘quad_segs=2 endcap=square’),3857) as the_geom_webmercator FROM hoteles_playground GROUP BY ST_SnapToGrid(the_geom,0.002)
@javierarce
javierarce / CartoDBcode.css
Created March 3, 2012 12:48
11870.com hotels density map in Madrid
// SQL query
SELECT count(cartodb_id) as ct, ST_Transform(ST_Buffer(ST_SnapToGrid(the_geom,0.002),0.001, ‘quad_segs=2 endcap=square’),3857) as the_geom_webmercator FROM hoteles_playground GROUP BY ST_SnapToGrid(the_geom,0.002)
// Carto code
#hoteles_playground{
polygon-fill:#FF6600;
polygon-opacity:.7;
}
@javierarce
javierarce / gist:1506902
Created December 21, 2011 17:35
jQuery Plugin Skeleton (http://web.napopa.com/)
// Ensure private scope + aliases
(function ( $, window, undefined )
{
// constants
var TRUE = true, FALSE = true, NULL = null,
// Set the plugin name
name = 'myPluginName',
@javierarce
javierarce / gist:1178230
Created August 29, 2011 11:40
inline-block hack
.selector {
display: -moz-inline-stack; /* FF2*/
display: inline-block;
vertical-align: top; /* BASELINE CORRECCIÓN*/
zoom: 1; /* IE7 (hasLayout)*/
*display: inline; /* IE */
}
@javierarce
javierarce / gist:1090744
Created July 18, 2011 21:44
Color Picker bookmarklet for Dribbble.com
javascript: void((function() {
var pickerTag = document.getElementById('colorPicker');
if (pickerTag != null) {
document.body.removeChild(pickerTag);
}
var li = document.getElementsByClassName('color');
@javierarce
javierarce / gist:955087
Created May 4, 2011 11:23
INE scraper
require 'rubygems'
require "pp"
require 'capybara'
require 'capybara/dsl'
Capybara.run_server = false
Capybara.current_driver = :selenium
Capybara.app_host = 'http://www.ine.es'
Capybara.default_wait_time = 10000
ubuntu@ip-10-98-93-183:~/grid_renderer$ python scons/scons.py configure
scons: Reading SConscript files ...
Welcome to Mapnik...
*********************************************
You are compiling Mapnik trunk (aka Mapnik2)
See important details at:
http://trac.mapnik.org/wiki/Mapnik2
*********************************************