Skip to content

Instantly share code, notes, and snippets.

View kapadia's full-sized avatar
💭
eating a pecan bar

Amit Kapadia kapadia

💭
eating a pecan bar
View GitHub Profile
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
#!/usr/bin/env python
import click
import numpy as np
import rasterio as rio
@click.command('append-mask')
@click.argument('srcpath', type=click.Path(exists=True))
@click.argument('dstpath', type=click.Path(exists=False))
@kapadia
kapadia / git-clean.sh
Created November 16, 2015 21:56
Delete files not checked in to git
git status | tail -n +5 | head -n -1 | ack-grep '#\s+(?P<file>.*)' --output $+{file} | parallel rm -rf {}
LC80140402015030LGN00
LC80180352015042LGN00
LC80911162015042LGN00
LC80500132015042LGN00
LC81230192015042LGN00
LC81710682015042LGN00
LC81230342015042LGN00
LC81870202015042LGN00
LC81231082015042LGN00
LC81550182015042LGN00
@kapadia
kapadia / response.xml
Last active October 18, 2015 04:04
Malformed USGS Response
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="https://earthexplorer.usgs.gov/inventory/soap" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:searchResponse><return xsi:type="ns1:Service_Inventory_SearchResponse"><numberReturned xsi:type="xsd:int">474</numberReturned><totalHits xsi:type="xsd:int">1473</totalHits><firstRecord xsi:type="xsd:int">1000</firstRecord><lastRecord xsi:type="xsd:int">1473</lastRecord><nextRecord xsi:type="xsd:int">1473</nextRecord><results SOAP-ENC:arrayType="ns1:Service_Inventory_InventoryScene[474]" xsi:type="ns1:ArrayOfService_Inventory_InventoryScene"><item xsi:type="ns1:Service_Inventory_InventoryScene"><acquisitionDate xsi:type="xsd:string">2015-10-16T18:23:34Z</acquisitionDate><startTime xsi:type="xsd:str
class JsonC < Formula
desc "JSON parser for C"
homepage "https://github.com/json-c/json-c/wiki"
url "https://github.com/downloads/json-c/json-c/json-c-0.9.tar.gz"
version "0.9"
sha256 "702a486c9bf8e19137d484ab5c49b4ad314eb5e1fe37062a72c0a0fa39439475"
bottle do
cellar :any
revision 1
@kapadia
kapadia / get_unfinished_scenes.py
Created September 26, 2015 21:07
List objects not updated since Aug 25
import sys
import pandas as pd
from datetime import datetime
def get(srcpath):
df = pd.read_csv(srcpath, delim_whitespace=True, names=['date', 'time', 'bytes', 'name'])
df['date'] = pd.to_datetime(df['date'])
tell application "System Events"
tell process "Preview"
repeat with i from 1 to (count windows)
set position of window i to {0, 0}
end repeat
end tell
end tell
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.