Skip to content

Instantly share code, notes, and snippets.

View steinbring's full-sized avatar

Joe Steinbring steinbring

View GitHub Profile
@steinbring
steinbring / app.py
Created July 21, 2024 20:30
A python script for using Ollama, Chroma DB, and the Culver's API to allow the user to query for the flavor of the day
import sys
import ollama
import chromadb
import requests
from datetime import datetime
# Fetch data from Culver's API
response = requests.get('https://culvers-fotd.joe.workers.dev/')
data = response.json()
@steinbring
steinbring / app.js
Last active July 20, 2024 19:02
A node proxy for getting the flavor of the day for the closest culver's locations to Milwaukee.
addEventListener('fetch', event => {
event.respondWith(handleRequest(event.request));
});
async function handleRequest(request) {
const url = 'https://www.culvers.com/api/locator/getLocations?lat=43.0386&long=-87.9067&radius=40233&limit=100&layer=';
try {
const response = await fetch(url);
const data = await response.json();
@steinbring
steinbring / app.js
Created June 16, 2024 23:52
The script handling replies on @joe@jws.app
const axios = require('axios');
const schedule = require('node-schedule');
const { instanceUrl, account, checkInterval, mentions, accessToken } = require('./config');
const fetchMentions = async () => {
try {
const response = await axios.get(`${instanceUrl}/api/v1/notifications`, {
headers: {
Authorization: `Bearer ${accessToken}`,
},
@steinbring
steinbring / oci8-php-macos-herd.md
Last active August 16, 2024 11:50
How to install the oci8 PHP plugin if you are using macOS and Laravel Herd
  1. There are two zip files on the Oracle website. Download them and unzip them into "/opt/oracle/instantclient_19_8". You will need to use "Grant Temporary Admin Rights" to create the folder.

    a. Basic Package (ZIP)

b. [SDK Package

@steinbring
steinbring / technologies.json
Last active March 21, 2024 19:38
An array of 40 application development technologies
{
"JavaScript": {
"name": "JavaScript",
"slug": "javascript",
"description": "JavaScript is a dynamic programming language, widely used for web development and in various non-browser environments.",
"homepage": "https://developer.mozilla.org/en-US/docs/Web/JavaScript",
"icon": "['fab', 'js']"
},
"HTML": {
"name": "HTML",
const admin = require('firebase-admin');
const fs = require('fs');
const { geohashForLocation } = require('geofire-common');
// Initialize Firebase Admin
const serviceAccount = require('./firebase-adminsdk.json');
admin.initializeApp({
credential: admin.credential.cert(serviceAccount)
});
const db = admin.firestore();
@steinbring
steinbring / taskling.js
Last active March 13, 2024 18:26
A command-line task tracking app for grim
// Make sure to run "chmod +x taskling.js" before doing anything
// To add a task, use node taskling.js -add 'Your task here'.
// To remove a task, use node taskling.js -rm 'Task to remove'.
// To display all tasks, simply run node taskling.js.
const fs = require('fs');
const path = require('path');
const filePath = path.join(__dirname, 'taskling.txt');
// Function to add a task
@steinbring
steinbring / counties.csv
Created January 13, 2024 17:12
A CSV of counties, county seats, and zip codes (contained in them) for the state of wisconsin
We can make this file beautiful and searchable if this error is corrected: It looks like row 2 should actually have 3 columns, instead of 6 in line 1.
County,County Seat,Zip Codes
Adams, Friendship, 53934, 53932, 53927, 53926
Ashland, Ashland, 54101, 54102
Barron, Barron, 54812, 54813, 54816
Brown, Green Bay, 54301, 54303, 54305, 54307, 54309, 54311, 54312, 54315, 54316, 54318, 54320, 54325, 54326
Buffalo, Buffalo City, 54415, 54416, 54419
Burnett, Grantsburg, 54840
Calumet, Brussels, 54724, 54725, 54726, 54733, 54748, 54749, 54751, 54752
Chippewa, Chippewa Falls, 54729, 54728, 54727, 54730, 54726, 54725, 54719
Clark, Neillsville, 54458, 54455, 54456
@steinbring
steinbring / index.js
Last active December 30, 2023 05:42
You can use this node script to post to Bluesky through it's API. You just need to set the username and app password and execute the script locally by running 'node index.js'.
const https = require('https');
function createBlueskyPost() {
const BLUESKY_HANDLE = 'XXX';
const BLUESKY_APP_PASSWORD = 'YYY';
const data = JSON.stringify({
identifier: BLUESKY_HANDLE,
password: BLUESKY_APP_PASSWORD,
});
addEventListener('fetch', event => {
event.respondWith(handleRequest(event.request));
});
async function handleRequest(request) {
const url = new URL(request.url);
let path = url.pathname;
// WebFinger endpoint for discovery
if (path === '/.well-known/webfinger') {