Skip to content

Instantly share code, notes, and snippets.

View joshdick's full-sized avatar
💭
😋

Josh Dick joshdick

💭
😋
View GitHub Profile
@beporter
beporter / add_to_cart.user.js
Last active August 18, 2023 21:43
Greasemonkey script to repeatedly refresh a given page, look for specific "Add to Cart" buttons, click them if present, and make a lot of noise on success.
// ==UserScript==
// @name Add Saved Items to Cart
// @namespace https://gist.github.com/beporter/ce76204bcba35d9edb66b395bb5e9305
// @version 0.5
// @description Repeatedly refresh a given "saved items" page (Amazon, Walmart, BestBuy), look for specific "Add to Cart" buttons, click them if present, and make a lot of noise on success.
// @author https://github.com/beporter
// @match https://www.amazon.com/gp/registry/wishlist/*
// @match https://www.amazon.com/hz/wishlist/ls/*
// @match https://www.bestbuy.com/cart
// @match https://www.bestbuy.com/site/customer/lists/manage/saveditems
@bryant988
bryant988 / zillow.js
Last active April 22, 2024 15:51
Zillow Image Downloader
/**
* NOTE: this specifically works if the house is for sale since it renders differently.
* This will download the highest resolution available per image.
*/
/**
* STEP 1: Make sure to *SCROLL* through all images so they appear on DOM.
* No need to click any images.
@chockenberry
chockenberry / tot.sh
Last active October 6, 2023 12:23
A shell script for Tot
#!/bin/sh
basename=`basename $0`
if [ -z "$*" ]; then
echo "usage: ${basename} <dot> [ -o | -r | <file> | - ]"
echo ""
echo "options:"
echo " -o open dot in window with keyboard focus"
echo " -r read contents of dot"
@cinakyn
cinakyn / Vim.scpt
Created October 29, 2019 05:07
Open files with iTerm vim
-- forked version of https://gist.github.com/charlietran/43639b0f4e0a01c7c20df8f1929b76f2
on run {input, parameters}
set paths to ""
repeat with i from 1 to length of input
set cur to item i of input
set paths to paths & " " & quote & POSIX path of cur & quote
end repeat
set cmd to "vim -p" & paths
tell application "iTerm"
@lorenzoferrante
lorenzoferrante / Shortify.js
Created December 2, 2018 21:23
Get track or playlist URL from user query
// Base64 encoding of your credentials
let clientID = '<your client id>'
let clientSecret = '<your client secret>'
let cred = clientID + ':' + clientSecret
let credEncoded = Data.fromString(cred).toBase64String()
let auth = 'Basic ' + credEncoded
// Get token
let tokenURL = 'https://accounts.spotify.com/api/token'
var reqToken = new Request(tokenURL)
@TrillCyborg
TrillCyborg / mastodon-docker-setup.md
Last active February 13, 2024 17:15
Mastodon Docker Setup

Mastodon Docker Setup

Setting up

Clone Mastodon's repository.

# Clone mastodon to ~/live directory
git clone https://github.com/tootsuite/mastodon.git live
# Change directory to ~/live

cd ~/live

@ChristoferK
ChristoferK / Open URLs in Safari.applescript
Created June 17, 2018 02:49
[Open URLs in Safari] An AppleScript that receives a list of URLs as input and opens them in new tabs of a specified existing window or, optionally, a new window, and can be set to do this in the background or by raising Safari to the foreground #Safari #tabs #URLs #AppleScript
property S : a reference to application "Safari"
global W
on run input -- input is a list of URLs
if (count input) is 0 then ¬
set the input to {¬
"alfredapp.com", ¬
"stackoverflow", ¬
"google.co.uk"}
@daemonp
daemonp / encrypted-root-arch-linux-pixelbook.md
Last active November 14, 2023 01:34
Installing Arch Linux on a Google Pixelbook (i7 16gb 500gb NVMe)

Overview

Stable enough for my initial use-case, light-duty laptop for travel and presentations, running Linux all the time but retain a small ChromeOS volume for firmware updates and restoring settings.

1st attempt I wiped the drive and then found that when the machine attempted to suspect when the lid closed it wiped the NVRAM with no other option to boot into legacy mode than to restore ChromeOS and enable it again.

  • Setup base system in ChromeOS
  • Fully encrypted Btrfs root partition & ext4 boot
  • Install Arch Linux
@ianks
ianks / slugify.sql
Last active October 31, 2023 05:03
Generating Slugs in Postgres
CREATE EXTENSION IF NOT EXISTS "unaccent";
CREATE OR REPLACE FUNCTION slugify("value" TEXT)
RETURNS TEXT AS $$
-- removes accents (diacritic signs) from a given string --
WITH "unaccented" AS (
SELECT unaccent("value") AS "value"
),
-- lowercases the string
"lowercase" AS (
@charlietran
charlietran / TerminalVim.scpt
Last active October 14, 2023 06:50
Open file in iTerm vim for MacOS Sierra
-- TerminalVim.app
-- This creates a shim Application that will enable you to open files from the Finder in vim using iTerm
-- To use this script:
-- 1. Open Automator and create a new Application
-- 2. Add the "Run Applescript" action
-- 3. Paste this script into the Run Applescript section
-- 4. Save the application as TerminalVim.app in your Applications folder
-- 5. In the Finder, right click on a file and select "Open With". In that window you can set TerminalVim as a default