Skip to content

Instantly share code, notes, and snippets.

View rgbink's full-sized avatar

Anthony DeCrescenzo rgbink

View GitHub Profile
@rgbink
rgbink / MyFitnessPal_AutoFocus_quantity_food_entry_editing.js
Last active May 17, 2016 06:10
MyFitnessPal UserScript to AutoFocus on quantity when editing a food entry
// ==UserScript==
// @name MyFitnessPal Input Focus
// @namespace http://www.rgbink.com/
// @version 0.1
// @author Anthony DeCrescenzo
// @match http*://www.myfitnesspal.com/food/diary*
// @grant none
// @description A script to automatically focus on the quantity input field when editing a food entry. So, if you click to edit a food item, when the popup appears the quantity will be highlighted, ready to be replaced/typed over.
// ==/UserScript==
@rgbink
rgbink / find-and-delete-mac-terminal.sh
Last active June 20, 2016 01:03
Find and Delete files in Mac OS X Terminal
# Substitute your search term for YOURSEARCH
find ./ -name 'YOURSEARCH' -exec rm {} \;
# Change the command you apply to the found files by adjusting the call after the -exec
# For example, to list the found files…
find ./ -name '._*' -exec ls -al {} \;
@rgbink
rgbink / git_overwrite_branch
Created June 4, 2015 18:25
Completely Overwrite chosen git branch
git checkout desired_branch // put in the name of the branch you wish to KEEP
git merge -s ours branch_to_be_replaced // put in the name of the branch you want to OVERWRITE
git checkout branch_to_be_replaced // put in the name of the branch you want to OVERWRITE
git merge desired_branch // put in the name of the branch you wish to KEEP
@rgbink
rgbink / phone-regex.js
Created March 23, 2017 19:55
Fairly robust phone validation regex
// basic US, no country code
((\(*\d{3}\)* *?)|(\d{3}[ -\.]*))?\d{3}[ -\.]*\d{4}
// leading country codes and optional repeat separators
^\s*(?:\+?(\d{1,3}))?[-. (]*(\d{3})[-. \/)]*(\d{3})[-. ]*(\d{4})(?: *x(\d+))?\s*$
@rgbink
rgbink / tab-close-chrome.scpt
Last active October 26, 2022 07:27
Applescript to Close particular tab(s) in Google Chrome
tell application "Google Chrome"
-- edit the following url to be as specific or generic as you wish
-- in my functioning script I've added the particular spreadsheet that I wish to close
set windowList to every tab of every window whose URL starts with "https://docs.google.com/spreadsheets/"
repeat with tabList in windowList
set tabList to tabList as any
repeat with tabItr in tabList
set tabItr to tabItr as any
delete tabItr
end repeat