Skip to content

Instantly share code, notes, and snippets.

@eheikes
eheikes / gist:c3eeb938f936488019703f27d78d61ff
Created July 3, 2017 21:19
webdriver.io bug with JS comments in selectorExecute
[16:16:49] COMMAND POST "/wd/hub/session"
[16:16:49] DATA {"desiredCapabilities":{"javascriptEnabled":true,"locationContextEnabled":true,"handlesAlerts":true,"rotatable":true,"browserName":"chrome","loggingPrefs":{"browser":"ALL","driver":"ALL"},"requestOrigins":{"url":"http://webdriver.io","version":"4.6.2","name":"webdriverio"}}}
[16:16:50] INFO SET SESSION ID 9b34bda9-9783-4f17-871f-c58ad0205b19
[16:16:50] RESULT {"applicationCacheEnabled":false,"rotatable":false,"mobileEmulationEnabled":false,"networkConnectionEnabled":true,"chrome":{"chromedriverVersion":"2.29.461585 (0be2cd95f834e9ee7c46bcc7cf405b483f5ae83b)","userDataDir":"/var/folders/s7/k3t4ylq15v3cqms7br186dxh0000gn/T/.org.chromium.Chromium.81Z3Qn"},"takesHeapSnapshot":true,"pageLoadStrategy":"normal","unhandledPromptBehavior":"","databaseEnabled":false,"handlesAlerts":true,"hasTouchScreen":true,"version":"59.0.3071.115","platform":"MAC","browserConnectionEnabled":false,"nativeEvents":true,"acceptSslCerts":true,"webdriver.remote.sessionid":"
@eheikes
eheikes / get-contributors.sh
Last active August 13, 2018 12:54
Get git contributors/authors
#!/bin/sh
# Gets list of contributors in "name <email>" format (with the quotes).
# Pass it the path.
git log --pretty=short --format="\"%aN <%aE>\"," $1 | sort | uniq
@eheikes
eheikes / settings.json
Last active June 26, 2018 18:22
Visual Studio Code (vscode) user settings
// Place your settings in this file to overwrite the default settings
{
"editor.acceptSuggestionOnEnter": "off",
"editor.find.seedSearchStringFromSelection": false,
"editor.fontSize": 14,
"editor.insertSpaces": false,
"editor.renderWhitespace": "all",
"editor.scrollBeyondLastLine": false,
"editor.tabSize": 2,
"editor.wordWrap": "on",
@eheikes
eheikes / list-open-issues.sh
Last active May 22, 2021 21:02
List all open, unassigned issues for selected Github repos
#!/bin/bash
#
# Lists all open, unassigned issues
# Requires https://github.com/stephencelis/ghi to be installed & configured.
#
# CHANGE THIS to the repositories you want to watch
REPOS=(
'eheikes/aws-tts'
'eheikes/browser-testing-talk'
@eheikes
eheikes / allmusic.js
Last active August 7, 2018 04:23
Hide allmusic top banner ad
// ==UserScript==
// @name Hide Allmusic ad at top of page
// @version 1.0
// @description Prevents shifting page
// @author Eric Heikes
// @include https://www.allmusic.com/*
// @grant none
// ==/UserScript==
(function() {
@eheikes
eheikes / .gitignore_global
Created June 27, 2016 20:17
~/.gitignore_global
# Compiled source #
###################
*.com
*.class
*.dll
*.exe
*.lo
*.la
*.o
*.so
@eheikes
eheikes / .gitconfig
Created June 15, 2016 20:29
User .gitconfig
[color]
diff = auto
status = auto
branch = auto
ui = auto
[core]
excludesfile = /Users/eheikes/.gitignore_global
autocrlf = input
safecrlf = true
pager = less -x3,5
@eheikes
eheikes / update-sys.sh
Last active September 20, 2018 20:49
Update system software (homebrew, gems, node)
#!/bin/bash
echo "Updating the system..."
echo ""
echo "Updating brew..."
brew update
brew upgrade
brew cleanup
@eheikes
eheikes / load-all-youtube.js
Last active February 17, 2024 23:44
Clicks the "Load More" button in a YouTube list until all videos are loaded.
(function() {
var len = 0;
function loadMore() {
window.scrollBy(0, 9999999);
setTimeout(function() {
var vids = document.querySelectorAll('ytd-playlist-video-renderer');
if (vids.length > len) {
len = vids.length;
loadMore();
}
@eheikes
eheikes / youtube-watchlater.js
Last active May 3, 2017 15:10
Randomly choose an item from your YouTube Watch Later queue. Run it when on that page.
(function(){
var vids = document.querySelectorAll('ytd-playlist-video-renderer');
var len = vids.length;
var i = Math.floor(Math.random() * len) + 1;
var vid = vids[i];
var title = vid.querySelector('#video-title').textContent;
console.log(title);
vid.scrollIntoView(true);
var mastheadHeight = document.getElementById('masthead-container').scrollHeight;
window.scrollBy(0,-mastheadHeight);