Skip to content

Instantly share code, notes, and snippets.

View VictorVelarde's full-sized avatar
🚀

Víctor Velarde VictorVelarde

🚀
View GitHub Profile
@VictorVelarde
VictorVelarde / index.html
Created May 2, 2019 08:51
[CARTO VL - Cluster count interactivity]
<!DOCTYPE html>
<html>
<head>
<title>Label clusters by count | CARTO VL</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script src="https://libs.cartocdn.com/carto-vl/v1.2.4/carto-vl.min.js"></script>
<script src="https://api.tiles.mapbox.com/mapbox-gl-js/v0.52.0/mapbox-gl.js"></script>
<link href="https://api.tiles.mapbox.com/mapbox-gl-js/v0.52.0/mapbox-gl.css" rel="stylesheet" />
<link rel="stylesheet" type="text/css" href="https://carto.com/developers/carto-vl/examples/maps/style.css">
@VictorVelarde
VictorVelarde / index.html
Last active April 9, 2019 17:49
[CARTO VL - blend vs bucket]
<!DOCTYPE html>
<html>
<head>
<title>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/v0.9.1/carto-vl.min.js"></script>
@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 / index.html
Last active April 9, 2019 17:47
[CARTO VL - Mix with deck.gl]
<html>
<head>
<title>CARTO VL & deck.gl</title>
<meta name='viewport' content='initial-scale=1,maximum-scale=1,user-scalable=no' />
<script src="https://unpkg.com/deck.gl@latest/deckgl.min.js"></script>
<script src="https://api.tiles.mapbox.com/mapbox-gl-js/v0.53.1/mapbox-gl.js"></script>
<link rel="stylesheet" type="text/css" href="https://api.tiles.mapbox.com/mapbox-gl-js/v0.53.1/mapbox-gl.css">
@VictorVelarde
VictorVelarde / index.html
Created April 8, 2019 09:08 — forked from ryanbaumann/index.html
Mapbox Custom Layers - Add a HexagonLayer to a map with deck.gl
<html>
<head>
<title>Road AccidentsIncidents</title>
<meta name='viewport' content='initial-scale=1,maximum-scale=1,user-scalable=no' />
<script src="https://unpkg.com/deck.gl@latest/deckgl.min.js"></script>
<script src="https://api.tiles.mapbox.com/mapbox-gl-js/v0.53.1/mapbox-gl.js"></script>
<link rel="stylesheet" type="text/css" href="https://api.tiles.mapbox.com/mapbox-gl-js/v0.53.1/mapbox-gl.css">
<script src="https://d3js.org/d3.v5.min.js"></script>
<style type="text/css">
@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">