Skip to content

Instantly share code, notes, and snippets.

View meetar's full-sized avatar

Peter Richardson meetar

View GitHub Profile
@celoyd
celoyd / hi8-anim-howto.md
Last active August 1, 2022 15:37
A way to make Himawari-8 animations

Himawari-8 animation tutorial

Here’s how to make animations like this one. It requires intermediate Unix command-line knowledge, to install some tools and to debug if they don’t work. You’ll need these utilities:

  • curl (or you can translate to wget)
  • convert and montage, part of ImageMagick
  • ffmpeg, plus whatever codecs
  • parallel, for iteration that’s nicer than shell for loops or xargs
  • run everything in zsh for leading 0s in numerical ranges to work
#!/usr/bin/env python
'''
Makes template filenames for interpolating Himawari-8 data.
Assumes filenames like "2015-11-28T023500.png".
I do this: python betwixt.py day-color | parallel --colsep ' ' convert -average {1} {2} {3}
'''
import os
import sys
@cjdd3b
cjdd3b / pairwise.py
Created February 5, 2013 18:32
Using Gensim and heapq for scalable pairwise document comparisons.
'''
pairwise.py
This script uses the Python Gensim library and heapq from the standard library to make
massively fast and scalable pairwise comparisons between an aribtrarily large number of
documents using TF-IDF and cosine distance.
The script first generates a similarity matrix between all documents in a set, then uses
heapq to retrieve the top K most similar matches to each document in that set. It has been
tested on sets as large as 400,000 documents on a Macbook Air.
@dergachev
dergachev / GIF-Screencast-OSX.md
Last active May 17, 2024 02:53
OS X Screencast to animated GIF

OS X Screencast to animated GIF

This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.

Screencapture GIF

Instructions

To capture the video (filesize: 19MB), using the free "QuickTime Player" application:

@jasonrudolph
jasonrudolph / git-branches-by-commit-date.sh
Created February 12, 2012 20:40
List remote Git branches and the last commit date for each branch. Sort by most recent commit date.
# Credit http://stackoverflow.com/a/2514279
for branch in `git branch -r | grep -v HEAD`;do echo -e `git show --format="%ci %cr" $branch | head -n 1` \\t$branch; done | sort -r