Skip to content

Instantly share code, notes, and snippets.

View steinbring's full-sized avatar

Joe Steinbring steinbring

View GitHub Profile
@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 June 13, 2024 18:53
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') {
@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",