Skip to content

Instantly share code, notes, and snippets.

View javierarce's full-sized avatar

Javier Arce javierarce

View GitHub Profile
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
*********************************************
@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
@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: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: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 / 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;
}
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)
// Configuration and API URL
var username = "YOUR_USERNAME";
var api_key = "YOUR_API_KEY"; // To get an API key go to http://www.last.fm/api/account
var url = "http://ws.audioscrobbler.com/2.0/?method=user.getrecenttracks&user=" + username + "&api_key=" + api_key + "&limit=1&format=json&callback=lastTrackCallback";
// API call
function getCurrentTrack() {
$.ajax({
url: url,
data: null,
@javierarce
javierarce / stemm_es.php
Created July 14, 2012 20:13
Stemm_es a stemming class for spanish
<?php
/*
Stemm_es a stemming class for spanish / Un lexemador para español
Copyright (C) 2007 Paolo Ragone
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
<!DOCTYPE html>
<html>
<head>
<script type="text/javascript" src="http://mbostock.github.com/d3/d3.js"></script>
<style>
.curve, .line {
fill: none;
stroke-width: 1px;
}
.curve {