Skip to content

Instantly share code, notes, and snippets.

View aaronlifton's full-sized avatar
:octocat:
AstroJS

Aaron Lifton aaronlifton

:octocat:
AstroJS
View GitHub Profile
@aaronlifton
aaronlifton / alacritty-tmux-vim_truecolor.md
Created October 21, 2023 16:52 — forked from andersevenrud/alacritty-tmux-vim_truecolor.md
True Color (24-bit) and italics with alacritty + tmux + vim (neovim)

True Color (24-bit) and italics with alacritty + tmux + vim (neovim)

This should make True Color (24-bit) and italics work in your tmux session and vim/neovim when using Alacritty (and should be compatible with any other terminal emulator, including Kitty).

Testing colors

Running this script should look the same in tmux as without.

curl -s https://gist.githubusercontent.com/lifepillar/09a44b8cf0f9397465614e622979107f/raw/24-bit-color.sh >24-bit-color.sh
@aaronlifton
aaronlifton / deleteAmazonSavedItems.js
Created August 24, 2023 00:38 — forked from MichaelLawton/deleteAmazonSavedItems.js
Removes all Amazon saved for later items on the cart page. It will only remove visible items. You might want to scroll first to make more items visible. To use paste code in developer console (Ctrl+Shift+J or Cmd+Opt+J in Chrome) then press enter.
function deleteSavedItems() {
var query = document.querySelectorAll("#sc-saved-cart input[value=Delete]")
if (query.length) {
query[0].click();
}
if (query.length > 1) {
setTimeout(deleteSavedItems,100);
}
else {
console.log('Finished');
@aaronlifton
aaronlifton / chatGPT-explanation-info.md
Created July 23, 2023 03:59 — forked from birkin/chatGPT-explanation-info.md
chatGPT code-explanation example

cool chatGPT info...

Recently experimenting with rust, I wanted to convert an image to a base64 string. I got some code working via my usual mix of trying stuff and googling. There was a step between loading the image and encoding it to a base64 string that I was curious about. I'd been hearing about copilot-explain, but only have copilot installed, and wanted to move forward. But I'd also recently been experimenting with chatGPT and thought I'd heard that it could explain code. Here's the result...

My prompt...

explain this code...

fn main() {
@aaronlifton
aaronlifton / karabiner.edn
Created July 10, 2023 02:31 — forked from andrewvmail/karabiner.edn
my-goku-file
{
;; my-goku
;; in hammerspoon console hs.ipc.cliInstall()
;; gokuw
;; gh gist edit d496e18751ddea5a9cb310755535389c -a karabiner.edn /Users/momo/.config/karabiner.edn
:templates {
:open "open \"%s\""
@aaronlifton
aaronlifton / nextdoor-unsubscribe.js
Last active July 22, 2023 19:49
unsubscribe from next-door emails
// https://nextdoor.com/settings/notification_prefs/
async function unsubscribe() {
matchingElementSet = document.evaluate("//span[text()='Email']/parent::div/following-sibling::input[contains(@aria-checked, 'true')]", document, null, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null);
for (let i = 0; i < matchingElementSet.snapshotLength; i++) {
await new Promise(r => setTimeout(r, 1000));
let currentEl = matchingElementSet.snapshotItem(i);
currentEl.click()
}
}
unsubscribe()
@aaronlifton
aaronlifton / s3_folder_upload.rb
Last active April 17, 2019 21:23 — forked from fleveque/s3_folder_upload.rb
Upload folder to S3 recursively with ruby, multi threads and aws-sdk v2 gem, based on http://avi.io/blog/2013/12/03/upload-folder-to-s3-recursively/
#!/usr/bin/env ruby
require 'rubygems'
require 'aws-sdk'
class S3FolderUpload
attr_reader :folder_path, :total_files, :s3_bucket, :include_folder
attr_accessor :files
# Initialize the upload class
@aaronlifton
aaronlifton / mastodon assets-precompile-on-other-machine.sh
Created November 2, 2017 06:38 — forked from skoji/mastodon assets-precompile-on-other-machine.sh
Mastodon : execute assets:precompile on a local machine.
# on the mastodon server
cd /home/mastodon/live
git checkout <release tag>
docker-compose pull && docker-compose build && docker-compose stop
# on the local machine
rsync -trzv --delete --rsync-path='sudo rsync' mastodon@server.example.com:/home/mastodon/live/ backup # get full backup
cd backup
docker-compose pull && docker-compose build && docker-compose run --rm web rails assets:precompile
cd ..
@aaronlifton
aaronlifton / describe_ec2_instances.sh
Created September 27, 2017 00:48
describe ec2 instances in all regions
for region in `aws ec2 describe-regions --output text | cut -f3`
do
echo -e "\nListing Instances in region:'$region'..."
aws ec2 describe-instances --region $region
done
@aaronlifton
aaronlifton / installing-node-for-ubuntu-with-nvm.md
Created September 11, 2017 20:26 — forked from d2s/installing-node-with-nvm.md
Installing Node.js for Ubuntu with nvm