Skip to content

Instantly share code, notes, and snippets.

View bolollo's full-sized avatar

bolo bolollo

View GitHub Profile
@bolollo
bolollo / placemark.kml
Created November 24, 2023 09:01
kml placemark example
<?xml version="1.0" encoding="utf-8"?>
<kml xmlns="http://www.opengis.net/kml/2.2">
<Document>
<Placemark>
<name>Portland</name>
<Point>
<coordinates>-122.681944,45.52,0</coordinates>
</Point>
</Placemark>
<Placemark>
@bolollo
bolollo / gist:4b2afabf11c8c35f6ebf1b696545bd14
Created July 26, 2018 13:02
capitalizar nombres de municipios
function toTitleCase(str){
str = str.toUpperCase();
str = str.replace(/\S*/g, function(txt){
if(!["DEL","LES","LA","DE", "EL", "I"].includes(txt)){
const re = /(.*)([L|D]')(.*)/i;
if(txt.match(re)){
if("" !== txt.match(re)[1]){
return toTitleCase(txt.match(re)[1]) + txt.match(re)[2].toLowerCase() + toTitleCase(txt.match(re)[3]);
}else{
return txt.match(re)[2].toLowerCase() + toTitleCase(txt.match(re)[3]);
@bolollo
bolollo / .gitignore
Last active January 2, 2018 14:16 — forked from rochoa/README.md
CARTO Node.js code test
.vscode
/node_modules/
npm-debug.log
<!DOCTYPE html>
<html>
<head>
<title>Trying to hide the layers| 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%;