Skip to content

Instantly share code, notes, and snippets.

View alexg0's full-sized avatar

Alexander Goldstein alexg0

  • Eligo Energy, LLC
  • Miami, FL
View GitHub Profile
@firexcy
firexcy / readme.md
Last active April 23, 2024 09:06
DIY a Rewind.ai

This Gist provides a solution to periodically capture screenshots of your Mac, and create therefrom a searchable PDF archive so that you can always get an answer to the “what, when, and where” questions about your usages.

To use these scripts:

  1. Download the shell script rewind, then:
    1. put it under ~/bin (or other fixed path you prefer);
    2. execute
@craigjperry2
craigjperry2 / Browser Extension Example
Last active September 19, 2021 14:22
Simple Example of Augmenting a Vendor App with a Browser Extension
Simple example of a browser extension to augment a vendor web-app for a poster on HN.
@carlosonunez
carlosonunez / auto_sudo_via_watch_and_tid.sh
Last active March 2, 2021 22:00
Enable support for sudo via Apple Watch and Touch ID
APPLE_WATCH_PAMID_LIBPATH=/usr/local/lib/pam/pam_watchid.so.2
APPLE_WATCH_PAMID_URL=https://github.com/biscuitehh/pam-watchid
APPLE_WATCH_PAMID_PATH=$HOME/src/pamid-applewatch
enable_sudo_with_apple_watch_and_touch_id() {
trap 'popd' EXIT INT HUP
enable_apple_watch() {
if ! test -f $APPLE_WATCH_PAMID_LIBPATH
then
if ! test -d $APPLE_WATCH_PAMID_PATH
@getaaron
getaaron / macos-messages-subject-field.md
Last active January 1, 2024 06:26
Enable iMessage (Messages) Subject Field in macOS Big Sur through Sonoma

Want the Subject field (for bold iMessages) in macOS’ Messages app?

  1. Quit Messages
  2. Open Terminal
  3. Run defaults write com.apple.MobileSMS MMSShowSubject 1
  4. Start Messages

This worked for me on a fresh install of macOS 14.1.1 (23B81) (new Mac mini).

@sulami
sulami / dc.sh
Last active August 14, 2021 17:43
Alfred dc RPN Calculator Workflow Script
query=$1
result=$( dc -e "$query pq" 2>&1 | tr -d '\\' | head -1 )
echo '{"items": ['
echo '{"title":'
echo "\"${result}\""
echo ','
echo '"subtitle": "Copy result to clipboard",'
echo '"arg":'
@sj26
sj26 / LICENSE.md
Last active March 8, 2024 18:31
Bash retry function

This is free and unencumbered software released into the public domain.

Anyone is free to copy, modify, publish, use, compile, sell, or distribute this software, either in source code form or as a compiled binary, for any purpose, commercial or non-commercial, and by any means.

In jurisdictions that recognize copyright laws, the author or authors of this software dedicate any and all copyright interest in the software to the public domain. We make this dedication for the benefit

@hyOzd
hyOzd / delete-file-and-buffer.el
Created July 21, 2015 11:55
emacs delete current file and close the buffer
;; based on http://emacsredux.com/blog/2013/04/03/delete-file-and-buffer/
(defun delete-file-and-buffer ()
"Kill the current buffer and deletes the file it is visiting."
(interactive)
(let ((filename (buffer-file-name)))
(if filename
(if (y-or-n-p (concat "Do you really want to delete file " filename " ?"))
(progn
(delete-file filename)
(message "Deleted file %s." filename)
@bitops
bitops / hipchat.el
Last active November 14, 2019 20:09
HipChat + jabber.el
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; use jabber-connect to connect. Make sure you tab to select the hipchat account if it's the ;;
;; only connection configured. ;;
;; ;;
;; a fork of https://gist.github.com/puffnfresh/4002033 ;;
;; ;;
;; shout out to http://emacs.stackexchange.com/questions/10940/connecting-to-hipchat-xmpp-via-jabber-el ;;
;; for the help. ;;
;; ;;
;; you can look up the necessary jabber info on the account i
@walesmd
walesmd / IconServiceAgent.md
Last active December 13, 2023 05:06
A lot of people are having issues with com.apple.IconServicesAgent. Since this is a very new issue, Google was no help and `man iconservicesd` is even more hilarious. I eventually fixed it, when I was working on a completely different issue (that is still not fixed). The instructions are below and on the Apple Support Forum, https://discussions.…

I was chasing down another issue (slow "Save As") and thought these two issues may have been related (with QuickLook being the common broken link). Unfortunately, my "Save As" dialog is still miserably slow on the initial load; but IconServicesAgent hasn't gone above 30MB and he rarely makes an appearance in the Console!

Some of these steps may not be necessary, but here are all of the steps I took that inadverdently put IconServicesAgent back in its place. Note: all commands are a single-line, if they appear to be multiple that's just the forum formatting.

  1. Check for any QuickLooks related .plist files. In a terminal: mdfind com.apple.quicklook. -name .plist

  2. I only had files at the system level (specifically within /System/Library/LaunchAgents/). If you have others, modify the directions below to take that into account (re-introducing plist files from the system level back up to the user).

  3. Make some temporary directories to store these plist files, just in case: mkdir ~/tmp-quicklook

@rodw
rodw / backup-github.sh
Last active May 15, 2024 02:33
A simple script to backup an organization's GitHub repositories, wikis and issues.
#!/bin/bash
# A simple script to backup an organization's GitHub repositories.
#-------------------------------------------------------------------------------
# NOTES:
#-------------------------------------------------------------------------------
# * Under the heading "CONFIG" below you'll find a number of configuration
# parameters that must be personalized for your GitHub account and org.
# Replace the `<CHANGE-ME>` strings with the value described in the comments
# (or overwrite those values at run-time by providing environment variables).