Skip to content

Instantly share code, notes, and snippets.

View VictorVelarde's full-sized avatar
🚀

Víctor Velarde VictorVelarde

🚀
View GitHub Profile
@VictorVelarde
VictorVelarde / basic-carto.sql
Last active April 9, 2019 17:48
[CARTO - Basic admin SQL] sql, carto
-- Connection to local vagrant env
-- localhost:9432 (NAT port 5432 --> external 9432)
-- database --> postgres
-- user --> postgres
-- Get databases in instance
SELECT datname FROM pg_database WHERE datistemplate = false;
@VictorVelarde
VictorVelarde / .tmux.conf
Created December 31, 2018 15:59
[Tmux configuration]
<2.1
```
set -g mode-mouse on
set -g mouse-resize-pane on
set -g mouse-select-pane on
set -g mouse-select-window on
```
On 2.1 this config got deprecated and the new option to allow all mouse support is:
@VictorVelarde
VictorVelarde / syntax.json
Last active December 30, 2018 14:59
[CARTO VL - Monarch syntax]
// Register a new language
monaco.languages.register({ id: 'carto-vl-string-api' });
// Register a tokens provider for the language
monaco.languages.setMonarchTokensProvider('carto-vl-string-api', {
tokenizer: {
root: [
[/\[error.*/, "custom-error"],
[/\[notice.*/, "custom-notice"],
[/\[info.*/, "custom-info"],
@VictorVelarde
VictorVelarde / index.html
Last active December 17, 2018 10:20
[CARTO VL - Conditional styling (JS)]
<!DOCTYPE html>
<html>
<head>
<title>Add layer | CARTO</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta charset="UTF-8">
<script src="https://libs.cartocdn.com/carto-vl/v1.0.0/carto-vl.min.js"></script>
<script src="https://api.tiles.mapbox.com/mapbox-gl-js/v0.50.0/mapbox-gl.js"></script>
<link href="https://api.tiles.mapbox.com/mapbox-gl-js/v0.50.0/mapbox-gl.css" rel="stylesheet" />
@VictorVelarde
VictorVelarde / index.html
Last active December 14, 2018 18:09
[CARTO VL - Groups on the fly]
<!DOCTYPE html>
<html>
<head>
<title>Add layer | CARTO</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta charset="UTF-8">
<script src="https://libs.cartocdn.com/carto-vl/v1.0.0/carto-vl.min.js"></script>
<script src="https://api.tiles.mapbox.com/mapbox-gl-js/v0.50.0/mapbox-gl.js"></script>
<link href="https://api.tiles.mapbox.com/mapbox-gl-js/v0.50.0/mapbox-gl.css" rel="stylesheet" />
@VictorVelarde
VictorVelarde / index.html
Created December 13, 2018 14:38 — forked from jsanz/index.html
CARTO VL: Selection by polygon
<!DOCTYPE html>
<html lang="en">
<head>
<title>CARTO VL: Selection by polygon example</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=5.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<link rel="shortcut icon" href="https://carto.com/favicon.ico">
@VictorVelarde
VictorVelarde / index.html
Last active November 28, 2018 11:11
[CARTO VL - nccc_may2018]
<!DOCTYPE html>
<html>
<head>
<title>Cluster | CARTO VL</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta charset="UTF-8">
<!-- Include CARTO VL JS -->
<script src="https://libs.cartocdn.com/carto-vl/v1.0.0/carto-vl.min.js"></script>
@VictorVelarde
VictorVelarde / index.html
Created November 21, 2018 10:00
[CARTO VL - viewportFeatures outside line]
<!DOCTYPE html>
<html>
<head>
<title>viewportFeatures intersecting line | CARTO</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta charset="UTF-8">
<script src="https://libs.cartocdn.com/carto-vl/v1.0.0/carto-vl.min.js"></script>
<script src="https://api.tiles.mapbox.com/mapbox-gl-js/v0.50.0/mapbox-gl.js"></script>
<link href="https://api.tiles.mapbox.com/mapbox-gl-js/v0.50.0/mapbox-gl.css" rel="stylesheet" />
@VictorVelarde
VictorVelarde / README.md
Last active November 19, 2018 18:11
[CARTO VL - Simple geojson created with geojson.io in a gist]

A simple CARTO VL map from a GeoJSON + 3 .geojson files (point, line, polygon)

@VictorVelarde
VictorVelarde / index.html
Last active November 7, 2018 19:17
[CARTO VL - Basic several layers]
<!DOCTYPE html>
<html>
<head>
<title>Select layer | CARTO</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta charset="UTF-8">
<script src="https://libs.cartocdn.com/carto-vl/v0.10.0/carto-vl.js"></script>
<script src='https://api.tiles.mapbox.com/mapbox-gl-js/v0.50.0/mapbox-gl.js'></script>
<link href='https://api.tiles.mapbox.com/mapbox-gl-js/v0.50.0/mapbox-gl.css' rel='stylesheet' />
<link href="https://carto.com/developers/carto-vl/examples/maps/style.css" rel="stylesheet">