Skip to content

Instantly share code, notes, and snippets.


Alexander Vey Way

View GitHub Profile
Way / fetch-urls.js
Created Apr 20, 2020
Fetch and wait for multiple requests using async, await, and Promise.all
View fetch-urls.js
async function fetchUrls(urls) {
try {
// Using Promise.all() coalesce multiple promises into a single "super-promise"
return await Promise.all(
// map urls to fetch requests and parse their response as json => fetch(url).then(response => response.json()))
} catch (error) {
Way / fb-remove-apps-script.js
Last active Mar 20, 2018
Disconnect apps where you used facebook to login #deleteFacebook
View fb-remove-apps-script.js
// Go to and open Devtools > Console.
// run until you die...
// find and click delete of the first app
// wait until the confirm modal pops up
// find and click the confirm button to delete the app
Way / parseLodash.js
Created Aug 9, 2015
Error handling for JSON.parse with lodash
View parseLodash.js
// With Lodash
function parseLodash(str){
return _.attempt(JSON.parse.bind(null, str));
parse('a'); // false
parseLodash('a'); // Return an error object
parse('{"name": "colin"}'); // Return {"name": "colin"}
parseLodash('{"name": "colin"}'); // Return {"name": "colin"}
Way /
Created Jul 26, 2015
Git hook "post-merge" to check and run npm, bower & composer on changed files
#!/usr/bin/env bash
# MIT © Sindre Sorhus -
# git hook to run a command after `git pull` if a specified file was changed
# Run `chmod +x post-merge` to make it executable then put it into `.git/hooks/`.
changed_files="$(git diff-tree -r --name-only --no-commit-id ORIG_HEAD HEAD)"
check_run() {
echo "$changed_files" | grep -E --quiet "$1" && eval "$2"
Way / rename-files
Last active Aug 29, 2015
Batch rename files to lowercase
View rename-files
# Found it here:
# Go to the directory and run the following command:
for /f "Tokens=*" %f in ('dir /l/b/a-d') do (rename "%f" "%f")
# Recursive version (added /r to dir):
for /f "Tokens=*" %f in ('dir /l/b/a-d/r') do (rename "%f" "%f")
Way / ghostwriter.js
Created Oct 6, 2014
Ghost Keyboard Writer
View ghostwriter.js
* Ghost Keyboard Writer
* Let the keyboard write for yourself.
* Simply use the following command:
* To control the speed of writing, use the first parameter
* to define the delay between to characters in milliseconds.
* START(50)
Way /
Last active Aug 29, 2015 — forked from JoelBesada/
Backtick "gmail" Command

This is an example command for Backtick. A Backtick command consists of some executable JavaScript and a bit of metadata in JSON.

Here are the required steps to create a command:

  1. Create a new Gist with a command.js and command.json file, or simply fork this one.

  2. Write your JavaScript in command.js. This will be injected into and executed on the page the user is currently on when they run it.

  3. Add some metadata to the command.json file:

  • name: The name of the command.
You can’t perform that action at this time.