Skip to content

Instantly share code, notes, and snippets.

@jqtrde
jqtrde / modern-geospatial-python.md
Last active August 1, 2023 14:50
Modern remote sensing image processing with Python
@jqtrde
jqtrde / aws-interactions.md
Created May 30, 2015 03:09
Interacting with AWS via the CLI

AWS gets easier once you learn the cli commands relevant to your workflow. That said, remembering some of the lengthier (and more useful) commands can be tough. Here's what I tend to use:

# Create an SSH keypair and save the key locally.
aws ec2 create-key-pair --key-name <KEYNAME> --profile default --query 'KeyMaterial' --output text > ~/.ssh/<KEYNAME>.pem

# Delete a keypair
aws ec2 delete-key-pair --key-name <KEYNAME> --profile default
@jqtrde
jqtrde / on-using-cloudformation.md
Last active August 29, 2015 14:22
On using Cloudformation

On using Cloudformation

Cloudformation is an AWS service for configuring and managing deployment of AWS resources in a declarative, reproducible fashion. Makes it possible to create entire architectures with a single command.

Templates can be created in the following ways:

  1. By hand
  2. Using Cloudformer, which creates a template based on existing infrastructure.
  3. Example templates provided by AWS
@jqtrde
jqtrde / resize.md
Last active August 29, 2015 14:22 — forked from drewbo/resize.md

How to create D3 visualizations that resize and scale well

When creating the SVG, add this bit of D3:

.attr("id","chart")
.attr("viewBox","0 0 960 500")
.attr("perserveAspectRatio","xMinYMid")

Then later in the code, add this bit of jQuery:

@jqtrde
jqtrde / panchunk.py
Last active August 29, 2015 14:24 — forked from celoyd/panchunk.py
# Beta-quality Landsat 8-oriented windowed pansharpener by Charlie Loyd
# python3 panchunk.py $SCENE/*B{4,3,2,8}.TIF ${SCENE}-pansharp.tif
# Then you may want something like this to brighten it up:
# convert -channel B -gamma 0.96 -channel RGB -sigmoidal-contrast 40,14% ${SCENE}-pansharp.tif ${SCENE}-pretty.tif
# But that will strip geo tags.
import asyncio
import rasterio as rio
@jqtrde
jqtrde / while-read.md
Created July 7, 2015 18:26
Iterating through lines in a file using bash

while read line: do echo $line < file.txt

@jqtrde
jqtrde / the-art-of-the-pass.md
Created July 26, 2015 23:45
Wenger on Passing.

On the Art of the Pass

Interviewer: What’s the secret? Is it timing, technique - what do you need to do to be a world class passer?

Wenger: First off, I would like to say that it’s the essence of our sport, because passing is experiencing — me giving away the ball to somebody else. So I love that because it’s the basic act of generosity, you know. Passing is being generous. And then, you have being generous in different ways. That means, you have that quality of the passing and the timing of the pass - you understand very well that if I give you the ball early you will have more time available to give the ball to somebody else. If I give you the ball a fraction of a second late, your opponent will have time to close you down and put you in trouble.

Then, I can give you as well, if I’m very intelligent, a pass that gives you already the best possible opportunity to see a solution and to give you a pass that makes the next solution available. Then I’m already in the second deg