git clone git@github.com:YOUR-USERNAME/YOUR-FORKED-REPO.git
cd into/cloned/fork-repo
git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git
git fetch upstream
#!/user/bin/python2.7 | |
#script for importing US Census Tract File | |
#works specifically for subfolder 'shapefiles' with x number of subfolders for each state | |
#requires pyshp library http://code.google.com/p/pyshp/ and psycopg2 postgresql library | |
import psycopg2 | |
import shapefile | |
import glob |
# Bulk convert shapefiles to geojson using ogr2ogr | |
# For more information, see http://ben.balter.com/2013/06/26/how-to-convert-shapefiles-to-geojson-for-use-on-github/ | |
# Note: Assumes you're in a folder with one or more zip files containing shape files | |
# and Outputs as geojson with the crs:84 SRS (for use on GitHub or elsewhere) | |
#geojson conversion | |
function shp2geojson() { | |
ogr2ogr -f GeoJSON -t_srs crs:84 "$1.geojson" "$1.shp" | |
} |
import fiona | |
import fiona.crs | |
def convert(f_in, f_out): | |
with fiona.open(f_in) as source: | |
with fiona.open( | |
f_out, | |
'w', | |
driver='GeoJSON', | |
crs = fiona.crs.from_epsg(4326), |
# -*- coding: utf-8 -*- | |
from netCDF4 import Dataset | |
#input file | |
dsin = Dataset("crop.nc") | |
#output file | |
dsout = Dataset("crop.nc3", "w", format="NETCDF3_CLASSIC") | |
#Copy dimensions |
import matplotlib as mpl | |
import matplotlib.pyplot as plt | |
import numpy as np | |
class MidpointNormalize(mpl.colors.Normalize): | |
""" | |
class to help renormalize the color scale | |
""" | |
def __init__(self, vmin=None, vmax=None, midpoint=None, clip=False): | |
self.midpoint = midpoint |
import asyncio | |
loop = asyncio.get_event_loop() | |
async def hello(): | |
await asyncio.sleep(3) | |
print('Hello!') | |
if __name__ == '__main__': | |
loop.run_until_complete(hello()) | |
#!/bin/bash | |
targettemp=90 | |
clockpct=70 | |
while true | |
do | |
currenttemp=$(sensors -u | awk '/temp1_input/ {print $2; exit}' ) | |
compare=$(echo $currenttemp'>'$targettemp | bc -l) | |
turbo=`cat /sys/devices/system/cpu/intel_pstate/no_turbo` | |
if [ "$turbo" -eq 0 ] |
import os, sys | |
from time import sleep | |
## We could update this to all files in all subdirectories | |
watching = [__file__] | |
watched_mtimes = [(f, os.path.getmtime(f)) for f in watching] | |
while True: | |
print("Idle...") | |
sleep(2) ## So not to kill our CPU cycles |
# setup | |
from cdo import * | |
cdo = Cdo() | |
cdo.debug = True | |
in_file = '/path/to/in_file.nc' | |
out_file = '/path/to/out_file.nc' | |
date1 = '2018-03-01T00:00:00' | |
date2 = '2018-03-01T02:00:00' | |
# my target is in meters |