Skip to content

Instantly share code, notes, and snippets.

View steinbring's full-sized avatar

Joe Steinbring steinbring

View GitHub Profile
@steinbring
steinbring / wisconsin-counties.json
Created November 24, 2023 18:08
A JSON object that contains all 72 counties in the state of wisconsin (including name, county seat, and zip codes)
{
"Wisconsin-Counties": [
{
"name": "Adams County",
"countySeat": "Friendship",
"zipCodes": [
"53910",
"53934",
"53936",
"54613",
@steinbring
steinbring / syncToFirestore.js
Created November 24, 2023 04:39
This node script syncs a JSON file to Firebase Cloud Firestore (make sure to "npm install firebase" first)
const { initializeApp } = require('firebase/app');
const { getFirestore, collection, addDoc } = require('firebase/firestore');
const fs = require('fs');
// Firebase configuration from your Firebase project
const firebaseConfig = {
apiKey: "XX",
authDomain: "XX",
projectId: "XX",
storageBucket: "XX",
@steinbring
steinbring / state-parks-and-forests.json
Last active November 24, 2023 04:09
A JSON object containing all state parks, state forests, and state recreation areas within the state of Wisconsin
{
"Wisconsin": {
"State Parks": [
{
"name": "Amnicon Falls State Park",
"type": "State Park",
"county": "Douglas County",
"parking": {
"latitude": 46.6082,
"longitude": -91.8922,
@steinbring
steinbring / CocktailList.vue
Created November 13, 2023 03:08
An example of how to use a Vue composable
<template>
<div>
<router-view/>
<h1>Cocktails</h1>
<ul>
<li v-for="cocktail in cocktails" :key="cocktail.url_slug">
<router-link :to="`/${level}/${cocktail.url_slug}`">{{ cocktail.name }}</router-link>
</li>
</ul>
@steinbring
steinbring / useCocktails.js
Created November 13, 2023 02:56
An example of a Vue composable
import { ref, onMounted } from 'vue';
import simpleCocktails from '../data/simple_cocktails.json';
import intermediateCocktails from '../data/intermediate_cocktails.json';
import advancedCocktails from '../data/advanced_cocktails.json';
export default function useCocktails(level) {
const cocktails = ref([]);
onMounted(() => {
switch(level) {
@steinbring
steinbring / cocktails.json
Created November 8, 2023 03:49
30 3-Ingredient Cocktails
{
"cocktails": [
{
"name": "Classic Margarita",
"ingredients": ["2 oz Tequila", "1 oz Triple sec", "1 oz Lime juice"],
"instructions": "Shake all ingredients with ice and strain into a salt-rimmed glass.",
"characteristics": ["Tangy", "Citrusy", "Refreshing"]
},
{
"name": "Mojito",
[
{
"title": "Joe's Vacation",
"start": "2022-06-15",
"end": "2022-06-29"
},
{
"title": "Sam's Vacation",
"start": "2022-06-20",
"end": "2022-07-05"
@steinbring
steinbring / index.js
Created November 22, 2021 02:57
The code behind https://addresstocoordinates.joe.workers.dev/?q=87714 (An API for converting from a municipality or zip code to latitude/longitude coordinates)
addEventListener('fetch', event => {
event.respondWith(handleRequest(event.request))
})
function getUrlVars(url) {
var vars = {};
var parts = url.replace(/[?&]+([^=&]+)=([^&]*)/gi, function(m,key,value) {
vars[key] = value;
});
return vars;
@steinbring
steinbring / cityStateToLatLong.json
Created November 20, 2021 20:44
JSON file of municipalities (Cities/States) and their corresponding latitude/longitude coordinates. (Source: 2021_Gaz_place_national.zip from https://www.census.gov/geographies/reference-files/time-series/geo/gazetteer-files.html)
This file has been truncated, but you can view the full file.
[
{
"state": "AL",
"city": "Abanda CDP",
"latitude": 33.091627,
"longitude": -85.527029
},
{
"state": "AL",
"city": "Abbeville city",
@steinbring
steinbring / zipCodeToLatLong.json
Created November 20, 2021 20:42
JSON file of five-digit ZIP codes and their corresponding latitude/longitude coordinates. (Source: 2021_Gaz_zcta_national.zip from https://www.census.gov/geographies/reference-files/time-series/geo/gazetteer-files.html)
This file has been truncated, but you can view the full file.
[
{
"zip": 601,
"latitude": 18.180555,
"longitude": -66.749961
},
{
"zip": 602,
"latitude": 18.361945,
"longitude": -67.175597