Skip to content

Instantly share code, notes, and snippets.

View aaronlifton's full-sized avatar

Aaron Lifton aaronlifton

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 / 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' [email protected]:/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 / 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
@aaronlifton
aaronlifton / routes.elm
Created May 30, 2017 19:52 — forked from hallettj/routes.elm
Example of a graph in Elm
import Html exposing (text)
import List exposing (concatMap, filter)
import List.Extra exposing (uniqueBy)
type alias CityId = Int
type alias City =
{ id: CityId
, name: String
}
@aaronlifton
aaronlifton / Enhance.js
Created May 30, 2017 18:08 — forked from sebmarkbage/Enhance.js
Higher-order Components
import { Component } from "React";
export var Enhance = ComposedComponent => class extends Component {
constructor() {
this.state = { data: null };
}
componentDidMount() {
this.setState({ data: 'Hello' });
}
render() {