This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.
To capture the video (filesize: 19MB), using the free "QuickTime Player" application:
<html> | |
<head> | |
</head> | |
<style type="text/css"> | |
.topad { | |
height: 26px; | |
position: absolute; | |
z-index: 999999999; | |
top: 0; |
// Open the Javascript console of your favourite browser | |
var jq = document.createElement('script'); | |
jq.src = "//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"; | |
document.getElementsByTagName('head')[0].appendChild(jq); | |
// ... give time for script to load, then type. | |
jQuery.noConflict(); | |
//Go to Facebook friends request page (https://www.facebook.com/friends/requests/?split=1&fcref=ft) |
// Open the Javascript console of your favourite browser | |
var jq = document.createElement('script'); | |
jq.src = "//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"; | |
document.getElementsByTagName('head')[0].appendChild(jq); | |
// ... give time for script to load, then type. | |
jQuery.noConflict(); | |
//Go to Facebook, search for your page, Go to 'Invite friends'. Scroll to make visible all your friends |
with lines as | |
(SELECT cartodb_id, color, ord, ST_Segmentize(ST_MakeLine(st_centroid(the_geom), lead(st_centroid(the_geom)) OVER (ORDER BY ord))::geography, 100000)::geometry as the_geom | |
FROM world_borders_four_colors_1_adjacency_list), | |
tosplit AS ( | |
SELECT * FROM lines | |
WHERE ST_XMax(the_geom) - ST_XMin(the_geom) > 180 | |
), | |
nosplit AS ( | |
SELECT * FROM lines | |
WHERE ST_XMax(the_geom) - ST_XMin(the_geom) <= 180 |
# first create a palette of the portion of the video with more colors | |
ffmpeg -y -ss 20 -t 3 -i input.mp4 -vf fps=50,scale=640:-1:flags=lanczos,palettegen palette.png | |
# then use the palette to obtain high quality colors | |
ffmpeg -i input.mp4 -i palette.png -filter_complex "fps=50,scale=640:-1:flags=lanczos[x];[x][1:v]paletteuse" output.gif | |
# -ss -> start from second | |
# -t -> duration |
A snippet to make a query to BigQuery and import the result in CARTO using both Python client libraries: | |
``` | |
#!/usr/bin/env python | |
import argparse | |
import time | |
import uuid | |
from tempfile import NamedTemporaryFile |
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Reacciones al #AccordDeParis</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%; |
<!DOCTYPE HTML> | |
<html> | |
<head> | |
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> | |
<link rel="stylesheet" href="http://libs.cartocdn.com/cartodb.js/v3/3.15/themes/css/cartodb.css" /> | |
<!-- <link rel="stylesheet" href="https://cartodb-libs.global.ssl.fastly.net/cartodb.js/v3/3.15/themes/css/cartodb.css" /> --> | |
<style type="text/css"> | |
html, |
insert into SEGMENTED_DATASET SELECT cartodb_id+n, ST_LineSubstring(the_geom, 100.00*n/length, | |
CASE | |
WHEN 100.00*(n+1) < length THEN 100.00*(n+1)/length | |
ELSE 1 | |
END) As the_geom | |
FROM | |
(SELECT TRACK_GPS.cartodb_id, | |
ST_LineMerge(TRACK_GPS.the_geom) AS the_geom, | |
ST_Length(TRACK_GPS.the_geom::geography) As length | |
FROM TRACK_GPS |