Skip to content

Instantly share code, notes, and snippets.

@jqtrde
jqtrde / shh.rb
Created March 8, 2018 16:19 — forked from robinsloan/shh.rb
Disable RTs from all the people you follow on Twitter.
require "rubygems"
require "twitter"
# get these from apps.twitter.com
CONSUMER_KEY = "foo"
CONSUMER_SECRET = "bar"
OAUTH_TOKEN = "blee"
OAUTH_TOKEN_SECRET = "baz"
TWITTER_USER = "your_username" # needs to be the one associated with keys above
@jqtrde
jqtrde / index.md
Created April 14, 2018 17:14
Stanford Big Data Hackathon - Tools for working with Satellite Imagery

Tools

We're very much Python powered!

  • rasterio - Reading and writing geospatial data (rasters)
  • shapely - Manipulation and analysis of geometric objects (vectors)
  • fiona - Reading and writing geospatial data (vectors)

The combination of ^ with other standard Python utilities provide a powerful & flexible means of achieving almost any sort of geospatial process you can imagine.

import random
import time
import json
import threading
import click
def send_message(msg, async=True):
"""Logs the msg (presumably a JSON object) to firehose
@jqtrde
jqtrde / tutorial.md
Created July 17, 2018 13:21 — forked from swalkinshaw/tutorial.md
Designing a GraphQL API

Tutorial: Designing a GraphQL API

This tutorial was created by Shopify for internal purposes. We've created a public version of it since we think it's useful to anyone creating a GraphQL API.

It's based on lessons learned from creating and evolving production schemas at Shopify over almost 3 years. The tutorial has evolved and will continue to change in the future so nothing is set in stone.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
from botocore.credentials import RefreshableCredentials
from botocore.session import get_session
from boto3 import Session
def assumed_session(role_arn, session_name, session=None):
"""STS Role assume a boto3.Session
With automatic credential renewal.
@jqtrde
jqtrde / README.md
Created March 15, 2020 19:46 — forked from clhenrick/README.md
PostgreSQL & PostGIS cheatsheet (a work in progress)
@jqtrde
jqtrde / install-arch.md
Last active June 15, 2023 20:41 — forked from mjnaderi/install-arch.md
Install Arch Linux with Full Disk Encryption (LVM on LUKS)

For a while, I thought that our modern culture's relationship to science best resembled the Catholic Church during the middle ages. Priests delivering sermons in Latin, indulgences, poor families of believers praying one of their sons would be bright enough for the clergy... Then I discovered the Druze.

"But when I asked him about the Druze faith, he gave me an unexpected reply. 'I know nothing about the Druze', the pre-eminent leader of the Druze declared with a violent wave of his arm. From his piles of books he selected a couple by Tariq Ali and gave them to me as gifts. He invited me to visit him at his palace in the mountains. And then he said goodbye. Either the most powerful Druze man in Lebanon, an intellectual in his own right, had been excluded from the teachings of his own religion, or else he knew better than to pass them on to an outsider. I had every intention of taking up his invitation to spend time among the Druze communities, but first I would have to find someone more willing to talk

@jqtrde
jqtrde / readme.md
Created June 3, 2020 11:56 — forked from kgjenkins/readme.md
TIFF compression options

TIFF compression options

Summary

Realistically, especially when considering the inherent noise in the original image, I'd settle for lossy compression with COMPRESS=JPEG JPEG_QUALITY=90, which could reduce file size fairly quickly to 16% of the original.

But if lossless compression is a hard requirement, I'd probably go with COMPRESS=LZW PREDICTOR=2. However, I would want to verify that any downstream tools wolud support this sort of compression.

UPDATE: When saving with JPEG compression, further speed and size improvements are gained by adding PHOTOMETRIC=YCBCR, which uses a different color space that has even better compression. I've added new rows to the table for YCBCR, as well as .jp2 formats.