Skip to content

Instantly share code, notes, and snippets.

View kissmygritts's full-sized avatar
🚀

Mitchell Gritts kissmygritts

🚀
View GitHub Profile
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
async function testConnection (db) {
try {
const c = await db.connect()
c.done()
console.log('CONNECTED')
} catch (error) {
console.log('RETRYING CONNECTION')
await testConnection(db)
}
}
@kissmygritts
kissmygritts / csv2sql.sh
Created May 3, 2022 22:38
Load a directory of csvs into postgres
#!/bin/sh
dir_path=$1
directory=$(cd "$dir_path" && pwd)
temp_dir=$(mktemp -d)
build_script="$directory/build.sql"
files=$(dir $dir_path)
# delete build script if exists
if [ -f "$build_script" ];
@kissmygritts
kissmygritts / nv-bbox.json
Created December 21, 2021 22:20
Bounding box of the Nevada, buffered by 0.5 degrees. EPSG 4326
[-120.50575, 34.50186, -113.54140, 42.49989]
@kissmygritts
kissmygritts / us-west-bbox.json
Created December 21, 2021 15:58
A JSON array of the bounding box for the US West (WA, OR, CA, ID, NV, AZ MT, UT, NM, WY, CO) ing EPGS:4326
[-124.80415, 31.23224, -101.94224, 49.10236]
@kissmygritts
kissmygritts / fetch-fishable-waters.r
Created August 24, 2021 21:24
Fetch spatial data from postgres database
library(DBI)
library(sf)
library(dplyr)
library(tidyr)
# replace with your connection details
con = DBI::dbConnect(
RPostgres::Postgres(),
dbname = '',
host = '',
const acm = require('@aws-cdk/aws-certificatemanager')
const ec2 = require('@aws-cdk/aws-ec2')
const ecs = require('@aws-cdk/aws-ecs')
const elbv2 = require('@aws-cdk/aws-elasticloadbalancingv2')
const ecr = require('@aws-cdk/aws-ecr')
const route53 = require('@aws-cdk/aws-route53')
const route53Targets = require('@aws-cdk/aws-route53-targets')
const serviceDiscovery = require('@aws-cdk/aws-servicediscovery')
const cdk = require('@aws-cdk/core')
@kissmygritts
kissmygritts / icons.md
Last active September 2, 2021 21:07
icon wish list

Animal silhouette outlines

Examples

We need the following animal icons:

  • HuntNV (total: 7): these icons should be mostly of the neck, head, and antlers/horns of the animal.
  • elk
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
st_bbox_to_poly <- function (bbox) {
x1 <- bbox[1]
y1 <- bbox[2]
x2 <- bbox[3]
y2 <- bbox[4]
sf::st_polygon(list(matrix(c(
x1, y1,
x1, y2,
x2, y2,