Skip to content

Instantly share code, notes, and snippets.

View walkerjeffd's full-sized avatar

Jeff Walker walkerjeffd

View GitHub Profile
@walkerjeffd
walkerjeffd / Synology-Diskstation-Git.md
Last active April 21, 2024 22:19
Instructions for setting up git server on Synology Diskstation

Configure Synology NAS as Git Server

Instructions for setting up a git server on a Synology NAS with Diskstation. Specifically, I am using a DS414 with DSM 5.0.

Set Up User and Folder

  • Create user gituser via Diskstation interface (with File Station and WebDAV privilages)
  • Add new shared folder called git (located at /volume1/git) with read/write access for gituser and admin. This folder will hold all the repos.
  • Install Git Server package via Diskstation
@walkerjeffd
walkerjeffd / rayshader-streamflow.R
Last active October 17, 2021 14:47
3D plot of ranked daily streamflow using {rayshader}
library(tidyverse)
library(dataRetrieval)
library(rayshader)
# install {av} to render movie
# install.packages("av")
# fetch daily streamflow from USGS NWIS
df_nwis <- readNWISdv(siteNumbers = "01059000", parameterCd = "00060") %>%
renameNWISColumns() %>%
@walkerjeffd
walkerjeffd / ghcnd-inventory-convert.py
Created February 10, 2014 14:48
Tools for processing GHCND text files
import pandas as pd
import csv
colspecs = [(0,11), (12,20), (21,30), (31,35), (36,40), (41,45)]
df = pd.read_fwf('ghcnd-inventory.txt', colspecs=colspecs, header=None, index_col=None)
df.columns = ["ID", "LATITUDE", "LONGITUDE", "ELEMENT", "FIRSTYEAR", "LASTYEAR"]
df.set_index("ID", inplace=True)
df.to_csv('ghcnd-inventory.csv', quoting=csv.QUOTE_NONNUMERIC)
[{"datetime":"2018-04-06 16:00:00","elev_ft":3.336,"Qin_ft":0.0113,"rain_ft":0.0058,"evap_ft":0.0005},{"datetime":"2018-04-06 17:00:00","elev_ft":3.3233,"Qin_ft":0.0064,"rain_ft":0.0033,"evap_ft":0.0005},{"datetime":"2018-04-06 18:00:00","elev_ft":3.3146,"Qin_ft":0,"rain_ft":0,"evap_ft":0.0005},{"datetime":"2018-04-06 19:00:00","elev_ft":3.3026,"Qin_ft":0,"rain_ft":0,"evap_ft":0.0005},{"datetime":"2018-04-06 20:00:00","elev_ft":3.2902,"Qin_ft":0,"rain_ft":0,"evap_ft":0.0005},{"datetime":"2018-04-06 21:00:00","elev_ft":3.2968,"Qin_ft":0,"rain_ft":0,"evap_ft":0.0005},{"datetime":"2018-04-06 22:00:00","elev_ft":3.3003,"Qin_ft":0,"rain_ft":0,"evap_ft":0.0005},{"datetime":"2018-04-06 23:00:00","elev_ft":3.311,"Qin_ft":0,"rain_ft":0,"evap_ft":0.0005},{"datetime":"2018-04-07 00:00:00","elev_ft":3.2998,"Qin_ft":0.0016,"rain_ft":0.0008,"evap_ft":0.0005},{"datetime":"2018-04-07 01:00:00","elev_ft":3.3023,"Qin_ft":0.0016,"rain_ft":0.0008,"evap_ft":0.0005},{"datetime":"2018-04-07 02:00:00","elev_ft":3.2884,"Qin_ft":0,"ra
@walkerjeffd
walkerjeffd / events.R
Last active March 9, 2018 21:43
R functions for assigning and summarizing storm events based on interevent period and minimum event total precipitation
assign.events <- function(df, datetime.name="DATETIME", value.name="VALUE", interevent=8, threshold=0.1) {
# assigns events to data frame such as storm events or discharge events
require(plyr)
if (!(datetime.name %in% names(df))) {
stop(paste0('Could not find datetime column called ', datetime.name))
}
if (!(value.name %in% names(df))) {
stop(paste0('Could not find value column called ', value.name))
}
if (!is.regular(df[, datetime.name])) {
@walkerjeffd
walkerjeffd / sketch.ino
Created May 25, 2014 17:35
Arduino Temperature and Humidity Logger using Adafruit SD Shield and DHT22
// log DHT sensor readings to SD card
#include "DHT.h"
#include <SD.h>
#include <Wire.h>
#include "RTClib.h"
RTC_DS1307 RTC;
// how many milliseconds between grabbing data and logging it. 1000 ms is once a second
#define LOG_INTERVAL 60000 // mills between entries (reduce to take more/faster data)
@walkerjeffd
walkerjeffd / .block
Last active May 20, 2017 12:53
Spinning Ovals III
license: mit
@walkerjeffd
walkerjeffd / .block
Last active May 19, 2017 23:25
Spinning Ovals II
license: mit
@walkerjeffd
walkerjeffd / .block
Created May 12, 2017 11:05
Spinning Ovals
license: mit
@walkerjeffd
walkerjeffd / .block
Created October 5, 2016 01:43
fresh block
license: mit