Skip to content

Instantly share code, notes, and snippets.

View davidofwatkins's full-sized avatar

David Watkins davidofwatkins

View GitHub Profile
@davidofwatkins
davidofwatkins / jscodemod-fmt.md
Last active February 21, 2023 17:23
jscodeshift: convert `String.fmt()` to template literal

This is a JS codemod written in jscodeshift to transform custom String.fmt() calls to template literals. For example:

const firstAnimalType = 'fox';
const secondAnimalType = 'dog';

'The big red %s jumps over the lazy brown %s'.fmt(firstAnamalType, secondAnimalType);

...is converetd to:

Keybase proof

I hereby claim:

  • I am davidofwatkins on github.
  • I am davidofwatkins (https://keybase.io/davidofwatkins) on keybase.
  • I have a public key whose fingerprint is 3820 4026 6E2C 8262 2834 E177 81C4 662D 9B48 6316

To claim this, I am signing this object:

@davidofwatkins
davidofwatkins / android-screenrecording.sh
Last active October 18, 2018 00:00
A utility to record your Android screen via ADB
if [[ ! $(which adb) ]]; then
echo "adb not found."
exit 1
fi
if [[ ! $(adb devices | grep "\tdevice") ]]; then
echo "No devices found."
exit 1
fi
@davidofwatkins
davidofwatkins / google-fonts-sync-git.md
Last active November 23, 2023 14:47
Keep MacOS Fonts Updated with Google Fonts

Google Fonts suggests syncing fonts to your computer with a tool called SkyFonts. However, if you're running MacOS and want to keep your machine updated with all Google Fonts without any extra software, you can do this with Git, thanks to the Google Fonts Repo.

To do this, run the following in your terminal:

cd ~/Library/Fonts/
git clone --depth 1 https://github.com/google/fonts.git google-fonts

Done! In the future, you can download new fonts by running:

@davidofwatkins
davidofwatkins / README.md
Created August 19, 2016 06:26
File Organization

This contains a few handy scripts for organizing files (particularly video files). First, use ./remove-non-video-files.sh to clear out any non-video files (and optionally non-subtitle files), then use ./org-files.sh to move all files matching a specified pattern into separate folders.

@davidofwatkins
davidofwatkins / nexus-dirty-flash-checklist.md
Last active September 6, 2016 19:04
A simple step-by-step guide for flashing a minor update and re-rooting for Nexus devices

Nexus Dirty Flash Checklist

This is a simple step-by-step guide for flashing a minor update (e.g., monthly security update) and re-rooting for Nexus devices.

This is meant to be more of a reminder checklist for those who do this semi-regularly; if you haven't done this before or don't know much about adb and fastboot, you should probably find a more detailed guide (see here for the Nexus 5X or here for the Nexus 6P).

Option 1: OTA Sideload (Recommended)

The easiest way to update your nexus device manually is through the OTA downloads provided by Google.