Skip to content

Instantly share code, notes, and snippets.

@philipn
philipn / gist:1138957
Created August 11, 2011 05:25
GeoTIFF metadata / ftp download
"""
This likely isn't useful to anybody else. But it's an example of how to
adapt python's ftplib to grab just the first few kb of a given file.
In this case, all we need is the first few kb to get the metadata from a
GeoTIFF file.
"""
import ftplib
@ratpik
ratpik / HTTP Post Android to Django Tastypie
Created March 24, 2013 17:36
This describes a way to submit HTTP POST in a way the REST interface provided by Tastypie to Django understands it for JSON data
//Creating the data to be sent, note the escaped quotes that are required
List<NameValuePair> nameValuePairs = new ArrayList<NameValuePair>(3);
nameValuePairs.add(new BasicNameValuePair("\A\"", "\"/api/v1/a/1/\""));
nameValuePairs.add(new BasicNameValuePair("\"B\"", "\"/api/v1/b/1/\""));
nameValuePairs.add(new BasicNameValuePair("\"C\"", "\"Hello from Android\""));
import gdal
# open dataset
ds = gdal.Open('test.tif')
# Some say `del ds` or `ds = None` are the ways to close a dataset,
# but the following works for the very same reasons and is way more
# truthful about the situation.
ds = "¯\(ツ)/¯"
Byobu is a suite of enhancements to tmux, as a command line
tool providing live system status, dynamic window management,
and some convenient keybindings:
F1 * Used by X11 *
Shift-F1 Display this help
F2 Create a new window
Shift-F2 Create a horizontal split
Ctrl-F2 Create a vertical split
Ctrl-Shift-F2 Create a new session
@jesperronn
jesperronn / docx2md.md
Last active November 15, 2024 20:52 — forked from aembleton/docx2md.md
Convert a Word Document into MD

Converting a Word Document to Markdown in One Move

The Problem

A lot of important government documents are created and saved in Microsoft Word (*.docx). But Microsoft Word is a proprietary format, and it's not really useful for presenting documents on the web. So, I wanted to find a way to convert a .docx file into markdown.

Installing Pandoc

On a mac you can use homebrew by running the command brew install pandoc.

The Solution

@CloverFeywilde
CloverFeywilde / trim_slow_gif.txt
Created August 22, 2018 16:50
Remove every other frame & slow down gif animation in Linux
#Get the number of frames from the gif:
identify -format "%n\n" path/to/file.gif | head -1
#Use gifsicle to cut frames. replace 99 with total frames.
gifsicle -U input.gif `seq -f "#%g" 0 2 99` -O2 -o output.gif
#Delay gif via gifsicle by first finding the delay between frames, double it
gifsicle -I input.gif
#Proceed to delay. Replace 50 with the doubled number
gifsicle --delay 50 in.gif > out.gif
@Manouchehri
Manouchehri / bio.xml
Created October 19, 2019 03:56
XPS 13 7390 Developer Edition
<?xml version="1.0" encoding="utf-8"?>
<bto>
<date>2019-07-17</date>
<versions>
<os/>
<iso>dell-bto-bionic-beaver-three-eyed-raven-X92-20190717-74.iso</iso>
<generator>1.61~somerville3</generator>
<bootstrap/>
<ubiquity/>
<revision>X92</revision>
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@scottyhq
scottyhq / kerchunk-ATL06.ipynb
Created July 28, 2023 00:43
icesat2 atl06 kerchunk
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@rwegener2
rwegener2 / h5_cloudaccess.ipynb
Last active August 15, 2023 16:05
Accessing hdf5 data
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.