Skip to content

Instantly share code, notes, and snippets.

Javier de la Torre jatorre

Block or report user

Report or block jatorre

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View gist:11371647
SELECT *,
'http://maps.googleapis.com/maps/api/streetview?size=300x190&location='||
ST_Y((the_geom))||','||ST_X((the_geom))
||'&sensor=false&fov=110' as image
FROM table_2012_entire_tree_down_complaints_sandy
@jatorre
jatorre / gist:9368356
Last active Aug 29, 2015
CartoDB 2 Sales/Account manager position
View gist:9368356
CartoDB 2 Sales/Account manager position
Who we are:
We are building the easiest and most powerful data mapping engine ever.
We have more than 40.000 loving users (growing rapidly) and customers
from all around the world. We have received awesome reviews from all the
key tech and startup media like Mashable today. And we have offices in
downtown Madrid and New York.
Our team of engineers and designers are changing the way maps are made.
@jatorre
jatorre / gist:9352791
Last active Aug 29, 2015
Vizzuality is looking for an awesome Office Manager in Madrid
View gist:9352791
Who we are:
We are building the easiest and most powerful data mapping engine ever. We have more than 40.000
loving users (growing rapidly) and customers from all around the world. We have received awesome
reviews from all the key tech and startup media like Mashable today. And we have offices in
downtown Madrid and New York.
Our team of engineers and designers are changing the way maps are made. This is a big task, we
need to scale! Because of that we need to complement our strong technical arm with your
organizational expertise and results driven attitude.
@jatorre
jatorre / gist:7401056
Created Nov 10, 2013
Removing the requirement for xml support on resolving tables function
View gist:7401056
-- Return an array of table names scanned by a given query
--
-- Requires PostgreSQL 9.x+
--
CREATE OR REPLACE FUNCTION CDB_QueryTables(query text)
RETURNS name[]
AS $$
DECLARE
exp JSON;
tables NAME[];
View gist:7336704
WITH summary_groups as(
WITH summary as (
select (row_number() over (order by time asc nulls last)+1)/2 as rownum,time
from sensor_log_2013_10_27_12_01
order by time asc)
SELECT
max(time) OVER(PARTITION BY rownum) -
min(time) OVER(PARTITION BY rownum) diff
FROM summary)
@jatorre
jatorre / gist:7210438
Created Oct 29, 2013
Geocoder/Reverse geocoder inside SQL
View gist:7210438
CREATE TYPE geocode_response AS (match_level text, latitude float, longitude float, address text, the_geom geometry);
CREATE OR REPLACE FUNCTION cdb_geocode(text) RETURNS SETOF geocode_response
AS $$ DECLARE
token text :='xxxx';
app_id text :='xxxx';
BEGIN
RETURN QUERY WITH geocode_response AS (
SELECT status, content_type,
content::json->'Response'->'View'->0->'Result'->0 as geocode_result
View gist:6623354
curl 'http://sz2.cartodb.com/tiles/layergroup' -H 'Pragma: no-cache' -H 'Origin: http://gfx.sueddeutsche.de' -H 'Accept-Encoding: gzip,deflate,sdch' -H 'Host: sz2.cartodb.com' -H 'Accept-Language: en-US,en;q=0.8' -H 'User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/30.0.1599.37 Safari/537.36' -H 'Content-Type: application/json' -H 'Accept: application/json, text/javascript, */*; q=0.01' -H 'Cache-Control: no-cache' -H 'Referer: http://gfx.sueddeutsche.de/politik/2013-09-15_LandtagswahlBayernWahlkarte/' -H 'Connection: keep-alive' --data-binary '{"version":"1.0.1","stat_tag":"f8515466-04da-11e3-ad81-938373fbfdcf","layers":[{"type":"cartodb","options":{"sql":"Select * FROM wahlen_by_2013","cartocss":"#wahlen_by_2013{ polygon-fill: #dedcd0; line-opacity: 1; polygon-comp-op: multiply; line-width: .5; line-color: #fff; polygon-opacity: 0;} ","cartocss_version":"2.1.0","interactivity":["cartodb_id"]}},{"type":"cartodb","options":{"sql":"Select * FROM wahle
@jatorre
jatorre / gist:6622239
Last active Dec 23, 2015
Small update example optimized
View gist:6622239
UPDATE wahlen_by_2013_test o
SET averagevalue=n.averagevalue,
constituencyname=n.constituencyname,
electionwinnerpartyname1=n.electionwinnerpartyname1,
electionwinnerpartyname2=n.electionwinnerpartyname2,
electionwinnerpartypercent1=n.electionwinnerpartypercent1,
electionwinnerpartyperson1=n.electionwinnerpartyperson1,
freie_waehler_percent2=n.freie_waehler_percent2,
gruene_percent2=n.gruene_percent2,
piraten_percent2=n.piraten_percent2,
@jatorre
jatorre / gist:6222402
Last active Dec 21, 2015
Here is a bit better
View gist:6222402
#locales_de_votaci_n_paso_2013_caba[vot_parcodigo=8] {::shadow {
marker-opacity: 1;
marker-allow-overlap: true;
marker-line-width: 0;
marker-line-opacity: 0;
image-filters: agg-stack-blur(5,5);
marker-fill: #2ca02c; [zoom<=12] {
marker-width: 8;
}
[zoom=13] {
View gist:5885430
./cdb_import.sh <cdb_username> <api_key> <file_name>
You can’t perform that action at this time.