- Bash/zsh completion
- use Tab to populate command line, narrows down options as you go, fills in container names, ID's, images, volumes. Huge time saver.
#!/bin/bash | |
[[ ! -n $5 ]] && echo "Usage: [ROTATE=90] gradientvideo <input.mp4> <r> <g> <b> <output.mp4>" && exit | |
set -x | |
[[ -n $ROTATE ]] && ROTATE=",scale=w=1.5*iw:h=1.5*ih,rotate=angle=$ROTATE" | |
ffmpeg -i "$1" -filter_complex "[0]split[v0][v1];[v0]format=rgba,geq=r=$2:g=$3:b=$4:a=255*(Y/H)$ROTATE[fg];[v1][fg]overlay=(W-w)/2:(H-h)/2:shortest=1" -q:v 2 "$5" |
EPSG: 4326 uses a coordinate system on the surface of a sphere or ellipsoid of reference. | |
WGS 84 - Earth as Geoid. -Mercator | |
EPSG: 3857 uses a coordinate system PROJECTED from the surface of the | |
sphere. Earth as perfectly sphere. -Web Mercator | |
Think of it as this way: | |
EPSG 4326 uses a coordinate system the same as a GLOBE (curved surface). | |
EPSG 3857 uses a coordinate system the same as a MAP (flat surface). |
wget https://github.com/google/protobuf/releases/download/v2.6.0/protobuf-2.6.0.tar.bz2 | |
tar xvf protobuf-2.6.0.tar.bz2 | |
cd protobuf-2.6.0 | |
./configure CC=clang CXX=clang++ CXXFLAGS='-std=c++11 -stdlib=libc++ -O3 -g' LDFLAGS='-stdlib=libc++' LIBS="-lc++ -lc++abi" | |
make -j 4 | |
sudo make install | |
protoc --version |
When you're working on multiple coding projects, you might want a couple different version of Python and/or modules installed. That way you can keep each project in its own sandbox instead of trying to juggle multiple projects (each with different dependencies) on your system's version of Python. This intermediate guide covers one way to handle multiple Python versions and Python environments on your own (i.e., without a manager like Anaconda). See the Using the workflow section to view the end result.
- Working on 2+ projects that each have their own dependencies; e.g., a Python 2.7 project and a Python 3.6 project, or developing a module that needs to work across multiple versions of Python. It's not reasonable to uninstall/reinstall modules every time you want to switch environments.
- If you want to execute code on the cloud, you can set up a Python environment that mirrors the relevant cloud
A Mapbox GL JS demo that creates a layer from a third-party tiles
source and draws it below the Mapbox Style's label layers. Layers in the Mapbox GL Style Spec draw in the order in which they're listed in the layers
array.
Look for the following in the style JSON below:
"sources": {
"mapbox": {
"url": "mapbox://mapbox.mapbox-streets-v7",
"type": "vector"
},
function slugify(text) | |
{ | |
return text.toString().toLowerCase() | |
.replace(/\s+/g, '-') // Replace spaces with - | |
.replace(/[^\w\-]+/g, '') // Remove all non-word chars | |
.replace(/\-\-+/g, '-') // Replace multiple - with single - | |
.replace(/^-+/, '') // Trim - from start of text | |
.replace(/-+$/, ''); // Trim - from end of text | |
} |
While the following structure is not an absolute requirement or enforced by the tools, it is a recommendation based on what the JavaScript and in particular Node community at large have been following by convention.
Beyond a suggested structure, no tooling recommendations, or sub-module structure is outlined here.
lib/
is intended for code that can run as-issrc/
is intended for code that needs to be manipulated before it can be used
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset=utf-8 /> | |
<title>Leaflet Image</title> | |
<meta name='viewport' content='initial-scale=1,maximum-scale=1,user-scalable=no' /> | |
<script src='https://api.tiles.mapbox.com/mapbox.js/v2.0.1/mapbox.js'></script> | |
<link href='https://api.tiles.mapbox.com/mapbox.js/v2.0.1/mapbox.css' rel='stylesheet' /> | |
<style> | |
body { margin:0; padding:0; } |