Skip to content

Instantly share code, notes, and snippets.

@edenwaith
edenwaith / CountOpenChromeTabs.scpt
Last active February 1, 2025 03:39
AppleScript: Count the number of open tabs in Google Chrome
-- CountOpenChromeTabs.scpt
-- Author: Chad Armstrong
-- Date: 30 August 2019
-- Description: Count the number of open tabs in Google Chrome
-- To run from CLI: osascript CountOpenChromeTabs.scpt
-- To create an alias command:
-- In ~/.bash_profile, add the line: alias counttabs='osascript ~/Projects/Scripts/CountOpenChromeTabs.scpt'
-- Refresh the bash shell environment: source ~/.bash_profile
tell application "Google Chrome"
@edenwaith
edenwaith / clear_cal_cache.sh
Last active March 1, 2024 07:54
Clear the cached calendars for macOS Calendar
#!/bin/sh
# Author: Chad Armstrong
# Date: 29 August 2018
# Description: Clear the cached calendars for macOS Calendar
# References:
# https://michaelkummer.com/technology/fix-calendar-cant-save-event-x-exchange/
# https://wilkinsit.ca/mac-osx/clear-calendar-cache-mac-os/
# https://stackoverflow.com/a/3510850/955122
@fxsjy
fxsjy / SimpleAuthServer.py
Created April 26, 2013 06:23
SimpleAuthServer: A SimpleHTTPServer with authentication
import BaseHTTPServer
from SimpleHTTPServer import SimpleHTTPRequestHandler
import sys
import base64
key = ""
class AuthHandler(SimpleHTTPRequestHandler):
''' Main class to present webpages and authentication. '''
def do_HEAD(self):