Skip to content

Instantly share code, notes, and snippets.

View matallo's full-sized avatar

Carlos Matallín matallo

View GitHub Profile
<!DOCTYPE html>
<html>
<head>
<title>Easy example | CartoDB.js</title>
<meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
<meta http-equiv="content-type" content="text/html; charset=UTF-8"/>
<link rel="shortcut icon" href="http://cartodb.com/assets/favicon.ico" />
<style>
html, body, #map {
height: 100%;

Launch Sublime Text 2 from the Mac OS X Terminal

Sublime Text 2 ships with a CLI called subl (why not "sublime", go figure). This utility is hidden in the following folder (assuming you installed Sublime in /Applications like normal folk. If this following line opens Sublime Text for you, then bingo, you're ready.

open /Applications/Sublime\ Text\ 2.app/Contents/SharedSupport/bin/subl

You can find more (official) details about subl here: http://www.sublimetext.com/docs/2/osx_command_line.html

Installation

For the favicon, it's best for cross-browser compatibility not to use any HTML. Just name the file favicon.ico and place it in the root of your domain. [1]

An .ico file is a container for multiple .bmp or .png icons of different sizes.

generate PNGs:

  • non-retina: 16×16px
  • retina: 32×32px

if you use Sketch you can use the this template:

Dear Google Google Maps Engine user,
This email is to inform you about some important updates regarding your ability to open and view Google Maps Engine (“GME”) maps in Google Earth.
GME users have had the ability to open and view the GME maps within Google Earth by logging into the Google Earth interface with with a Google Account that has been authorized to view the map. To date, Google Earth has implemented OAuth 1.0, an open standard for authorization, to authenticate users who log in. As a part of a Google-wide initiative to implement more scalable and secure solutions, Google Earth will be updating its login implementation to utilize the new OAuth 2.0 standard.
A new version of Google Earth (version 7.1.5) has now been released for download which supports the new OAuth 2.0 standard. We highly encourage you to update your current version of Google Earth if you would like to continue accessing and viewing your GME maps in Google Earth. Note though that after May 29, 2015, OAuth 1.0 will no longer be su
<!DOCTYPE html>
<html>
<head>
<title>Easy example | CartoDB.js</title>
<meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
<meta http-equiv="content-type" content="text/html; charset=UTF-8"/>
<link rel="shortcut icon" href="http://cartodb.com/assets/favicon.ico" />
<style>
html, body, #map {
height: 100%;
ALTER TABLE partidos_1_georef ALTER COLUMN register_date_mod TYPE DATE
using to_date(register_date, 'DD-MM-YYYY');
for(var i = 0; i < vizjson.layers.length; ++i) {
var torqueIndex;
if (vizjson.layers[i].type === 'torque') {
torqueIndex = i;
createTorqueLayer(torqueIndex, attempt++);
} else {
cartodb.createLayer(self.map, vizjson, { layerIndex: i })
.done(function(layer) {
self.map.addLayer(layer);
<!DOCTYPE html>
<html>
<head>
<title>Easy example | CartoDB.js</title>
<meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
<meta http-equiv="content-type" content="text/html; charset=UTF-8"/>
<link rel="shortcut icon" href="http://cartodb.com/assets/favicon.ico" />
<style>
html, body, #map {
height: 100%;
require 'nokogiri'
require 'typhoeus'
BEDCA_URL = "http://www.bedca.net/bdpub/procquery.php"
data_list = "<?xml version=\"1.0\" encoding=\"utf-8\"?><foodquery><type level=\"1\"/><selection><atribute name=\"f_id\"/><atribute name=\"f_ori_name\"/><atribute name=\"langual\"/><atribute name=\"f_eng_name\"/><atribute name=\"f_origen\"/><atribute name=\"edible_portion\"/></selection><condition><cond1><atribute1 name=\"f_origen\"/></cond1><relation type=\"EQUAL\"/><cond3>BEDCA</cond3></condition><order ordtype=\"ASC\"><atribute3 name=\"f_id\"/></order></foodquery>"
req_list = Typhoeus::Request.new(
BEDCA_URL,
method: :post,
require 'nokogiri'
require 'csv'
f_all = File.open("all.xml")
xml_all = Nokogiri::XML(f_all)
xml_all.search('food').each do |food|
f_id = food.at("f_id").text
puts "-- Opening #{f_id}.xml"