Skip to content

Instantly share code, notes, and snippets.

View mscottford's full-sized avatar
🔎
hunting for code to clean up

M. Scott Ford mscottford

🔎
hunting for code to clean up
View GitHub Profile
@mscottford
mscottford / playwright-approve-command-button.js
Last active February 28, 2024 19:38
Tampermonkey script for Playwright Test Report, adds a button that copies an "approve" command to the clipboard
// ==UserScript==
// @name Playwright Approve Button
// @namespace http://tampermonkey.net/
// @version 2024-02-28
// @description Adds a button to the Playwright Test Report that makes it easier to "approve" a snapshot by copying a command to the clipboard.
// @author M. Scott Ford
// @match http://localhost:9323/
// @grant none
// @run-at document-idle
// ==/UserScript==
/*----------------------------------------------------------------------
* "Agatha Christie" Problem
* Who was the killer?
*
* Alice, her husband, son, daughter,
* and brother are involved in a murder.
* One of the five killed one of the other
* four.
*
* 1. A man and a woman were together in the bar
@mscottford
mscottford / Zencastr Recovery Script.md
Last active March 23, 2023 16:03
Small snippet to recover local recordings Zencastr has stored in IndexedDB. I used this to recover an audio file that failed to upload.

Zencastr Recovery Script

This is a small snippet to recover local recordings Zencastr has stored in IndexedDB. I used this to recover an audio file that failed to upload.

To run it (instrutions for Google Chrome, you may have to adapt for other web browsers):

  1. open the web browser you were using when you made the recording,
  2. visit the Zencastr URL where you made the recording,
  3. right click on the page and select "Inspect",
  4. click on the "Console" tab,
  5. paste the script into the prompt and hit enter.
Feature: `git clone` command
Used to clone the project into the cache directory.
```
freshli [global options] git clone [command options] <repository-url>
```
**What this command does?**
@mscottford
mscottford / CrashReport.txt
Created February 8, 2022 14:50
Workrave macOS build troubleshooting
-------------------------------------
Translated Report (Full Report Below)
-------------------------------------
Process: workrave [22245]
Path: /Applications/Workrave.app/Contents/MacOS/Workrave
Identifier: workrave
Version: ???
Code Type: ARM-64 (Native)
Parent Process: launchd [1]
@mscottford
mscottford / README.md
Last active March 26, 2021 15:42
Git Churn command

Instructions for running on Windows 10 (via Ubuntu Bash)

  1. Open Ubuntu bash environment shell
  2. Install dependencies
    sudo apt-get update
    sudo apt-get install git curl
    
  3. Create bin directory in your home folder
afterburner-7:mob-timer mscottford$ node -v
v11.7.0
afterburner-7:mob-timer mscottford$ node -v
v11.7.0
afterburner-7:mob-timer mscottford$ npm -v
6.5.0
afterburner-7:mob-timer mscottford$ npm list
// Run this from the console in Chrome when viewing an image on WallpapersCraft.
// It will download the 3840x2400 version of the image to your downloads folder.
// Example url: https://wallpaperscraft.com/wallpaper/television_wire_interference_57268
console.save = function(url) {
e = document.createEvent('MouseEvents');
a = document.createElement('a');
a.download = url;
a.href = url;
e.initMouseEvent('click', true, false, window, 0, 0, 0, 0, 0, false, false, false, false, 0, null);
@mscottford
mscottford / Dockerfile
Last active January 31, 2018 03:52
Docker and docker-compose setup for a simple node environment which is setup to support using `yarn` and `yo`
FROM node:9.3
RUN apt-get update
RUN apt-get install sudo
RUN adduser --disabled-password --gecos '' docker
RUN adduser docker sudo
RUN echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers
USER docker
@mscottford
mscottford / heroku.rake
Created March 13, 2012 12:46
Rake task for restarting Heroku workers
# Add `gem 'heroku-api', :git => 'https://github.com/heroku/heroku.rb.git'` to your Gemfile
# Set the APP_NAME environment variable to the name of the Heroku app you wish to control.
# Set the HEROKU_API_KEY environment variable to the API key found on the Heroku 'My Account' page.
# You can now create a scheduler instance that runs `bundle exec rake heroku:workers:restart` to automate
# restarting workers at a regular interval.
namespace :heroku do
namespace :workers do
task :restart do