Skip to content

Instantly share code, notes, and snippets.

Ivan Malagon ivanmalagon

  • Madrid
Block or report user

Report or block ivanmalagon

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View gist:6c2e4d29aa70e9d4746c42104bed1945
Props tips
https://codesandbox.io/s/sc-props-ppsij
const Paragraph2 = styled.p(
props => css`
width: 400px;
margin: auto;
/* props can be accessed from the above props */
color: ${props.color};
View index.js
function S4 () {
return (((1 + Math.random()) * 0x10000) | 0).toString(16).substring(1);
}
@ivanmalagon
ivanmalagon / bundle.js
Created Jun 6, 2018
Madrid commuting - Hackarto VL
View bundle.js
/******/ (function(modules) { // webpackBootstrap
/******/ // The module cache
/******/ var installedModules = {};
/******/
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/
/******/ // Check if module is in cache
/******/ if(installedModules[moduleId])
/******/ return installedModules[moduleId].exports;
@ivanmalagon
ivanmalagon / index.js
Created Apr 2, 2018
BICIMAD AND SQL API
View index.js
const axios = require('axios');
const CLIENT_ID = 'YOUR_BICIMAD_CLIENT_ID';
const PASSKEY = 'YOUR_BICIMAD_PASSKEY';
const USERNAME = 'YOUR_USERNAME';
const TABLE_NAME = 'YOUR_TABLE_NAME';
const API_KEY = 'YOUR_CARTO_API_KEY';
const BICIMAD_URL = `https://rbdata.emtmadrid.es:8443/BiciMad/get_stations/${CLIENT_ID}/${PASSKEY}/`;
const BATCH_QUERY_URL = `https://${USERNAME}.carto.com/api/v2/sql/job?api_key=${API_KEY}`;
const MAX_JOB_SIZE = 16000;
@ivanmalagon
ivanmalagon / index.html
Last active Mar 12, 2018
Get bounds in CARTO.js
View index.html
<!DOCTYPE html>
<html>
<head>
<title>Bounds example | CARTO</title>
<meta name="viewport" content="initial-scale=1.0">
<meta charset="utf-8">
<!-- Include Leaflet -->
<script src="https://unpkg.com/leaflet@1.3.1/dist/leaflet.js"></script>
<link href="https://unpkg.com/leaflet@1.3.1/dist/leaflet.css" rel="stylesheet">
<!-- Include CARTO.js -->
@ivanmalagon
ivanmalagon / index.html
Created Jan 12, 2018
MapboxGL with CARTO MVT
View index.html
<!DOCTYPE html>
<html>
<head>
<meta charset='utf-8' />
<title>Carto - Windshaft Aggregation API - Mapbox GL example</title>
<meta name='viewport' content='initial-scale=1,maximum-scale=1,user-scalable=no' />
<script src='https://api.tiles.mapbox.com/mapbox-gl-js/v0.43.0/mapbox-gl.js'></script>
<link href='https://api.tiles.mapbox.com/mapbox-gl-js/v0.43.0/mapbox-gl.css' rel='stylesheet' />
<link href="https://fonts.googleapis.com/css?family=Open+Sans" rel="stylesheet">
View index.html
<!DOCTYPE html>
<html>
<head>
<meta charset='utf-8' />
<title>OpenLayers – Vector tiles – Points aggregation | CARTO</title>
<link rel="stylesheet" href="https://openlayers.org/en/v4.6.4/css/ol.css" type="text/css">
<script src="https://openlayers.org/en/v4.6.4/build/ol.js"></script>
<script src="https://openlayers.org/en/v4.6.4/examples/resources/mapbox-streets-v6-style.js"></script>
<style>
@ivanmalagon
ivanmalagon / index.html
Last active Nov 21, 2017
HaCkARTO.js boilerplate
View index.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>CARTO.js App</title>
<!-- Include Leaflet 1.2.0 Library -->
<link rel="stylesheet" href="https://unpkg.com/leaflet@1.2.0/dist/leaflet.css" />
<script src="https://unpkg.com/leaflet@1.2.0/dist/leaflet.js"></script>
<!-- Include cartodb.js Library -->
<script src="https://rawgit.com/CartoDB/cartodb.js/dist/carto.js"></script>
@ivanmalagon
ivanmalagon / index.html
Created Sep 22, 2016
Easing function proof of concept
View index.html
<html>
<head>
<style>
.orange {
height: 64;
width: 64;
margin-top: 64;
margin-left: 64;
background-color: orange;
}
@ivanmalagon
ivanmalagon / createobject.js
Last active Aug 29, 2015
Create object in Javascript - As seen on 'The good parts'
View createobject.js
if (typeof Object.create !== 'function') {
Object.create = function(o) {
var F = function() {};
F.prototype = o;
return new F();
};
}
You can’t perform that action at this time.