This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Copyright (c) 2024 Joe Heitzeberg | |
# Released under MIT License | |
module RedisUtil | |
module Cache | |
def self.redis | |
redis_host = ENV['REDIS_HOST'] | |
redis_port = ENV['REDIS_PORT'] | |
redis_db_num = 0 | |
$redis ||= Redis.new(host: redis_host, port: redis_port, db: redis_db_num) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Path to the iMessage database, adjust if necessary | |
DB_PATH=~/Library/Messages/chat.db | |
# Loop through years from 2016 to 2024 | |
for YEAR in {2016..2024} | |
do | |
echo "Exporting messages for $YEAR..." | |
sqlite3 "$DB_PATH" <<EOF |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Ruby code to print the US dollar relative buying power vs 1 year ago at various popular travel destinations | |
CURRENCY_API_KEY = "get one for free at https://apilayer.com/marketplace/exchangerates_data-api?live_demo=show" | |
def self.currency_report | |
# using a public exchange rate API, get the historic rate vs. today's and compute the % change. | |
# List currencies of popular travel destinations | |
currencies = [ | |
{code: "JPY", name: "Japanese Yen"}, | |
{code: "EUR", name: "Euro"}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Quick hack to get blink(1) to light up while monitoring osx network usage | |
# Based on "Simple script to monitor network usage on OSX - Joe McManus 2011/03/30 [email protected]" | |
#Interval between tests in seconds, change this to whatever you want | |
interval=1 | |
if [ -z $1 ] | |
then | |
echo "ERROR: No interface specified" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function myFunction() { | |
var email_lists = ["Cam Site", "Personal"]; | |
var to_emails_by_list = ["[email protected], [email protected]", "[email protected]"]; | |
var ss = SpreadsheetApp.getActiveSpreadsheet(); | |
var spreadsheet_name = ss.getName(); | |
var sheet = ss.getSheets()[0]; | |
var data = sheet.getRange("A1:D4000").getValues(); | |
var today = new Date(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function onFormSubmit(e) { | |
var to_email = "[email protected]"; | |
var ss = SpreadsheetApp.getActiveSpreadsheet(); | |
var spreadsheet_name = ss.getName(); | |
var sheet = ss.getSheets()[0]; | |
var columns = sheet.getRange("A1:U1").getValues()[0]; | |
var email_subject = "New response for [" + spreadsheet_name + "]"; | |
var email_body = "Spreadsheet: " + spreadsheet_name + "\r\n\r\n"; | |
var email_body_html = "<p><b>Spreadsheet: " + spreadsheet_name + "</b></p>"; |