Skip to content

Instantly share code, notes, and snippets.

@davidlwatsonjr
davidlwatsonjr / TaskbarToggle.ahk
Created March 9, 2016 06:15
An AutoHotkey script that toggles auto-hide on the Windows taskbar.
WinWait, ahk_class Shell_TrayWnd,
IfWinNotActive, ahk_class Shell_TrayWnd, , WinActivate, ahk_class Shell_TrayWnd,
WinWaitActive, ahk_class Shell_TrayWnd,
Send, {APPSKEY}r
WinWait, Taskbar and Start Menu Properties,
IfWinNotActive, Taskbar and Start Menu Properties, , WinActivate, Taskbar and Start Menu Properties,
WinWaitActive, Taskbar and Start Menu Properties,
Send, {ALTDOWN}u{ALTUP}{ENTER}
var loopThroughSongsAnd = function(doThis, interval, runMax) {
console.time('Looping through songs');
var getIntOrDefault = function(variable, defaultValue) {
variable = parseInt(variable, 10);
if (isNaN(variable) || !variable) {
variable = getIntOrDefault(defaultValue, 0);
}
return variable;
}
@davidlwatsonjr
davidlwatsonjr / google-play-music-deduplicator.js
Created February 14, 2017 20:38
Google Play Music Deduplicator
var mainPanel = document.querySelector("#mainContainer");
var lastProcessedSong = '';
mainPanel.scrollTop = 0;
function processSong() {
var topSong = document.querySelector('.song-table tr.song-row');
console.log(topSong);
if (topSong.dataset.id !== lastProcessedSong) {
var nextSong = document.querySelector('.song-table tr.song-row:nth-child(3)');
var topSongTitle = topSong.querySelector('[data-col=title] .column-content').textContent;
var nextSongTitle = nextSong.querySelector('[data-col=title] .column-content').textContent;
@davidlwatsonjr
davidlwatsonjr / hide-google-keep-sidebar.user.js
Created January 5, 2017 06:29 — forked from qgustavor/hide-google-keep-sidebar.user.js
Hide by default Google Keep Sidebar
// ==UserScript==
// @name Hide by default Google Keep Sidebar
// @namespace üsersçrìpts@blio.tk
// @include https://keep.google.com/*
// @version 1
// @grant none
// @run-at document-idle
// ==/UserScript==
document.querySelector('[aria-label="Main Menu"]').click();
<link rel="import" href="//polygit.org/components/polymer/polymer.html" />
<dom-module id="parallax-parent">
<template>
<style>
:host {
position: relative;
overflow: hidden;
}
:host ::content [parallax-speed] {
@davidlwatsonjr
davidlwatsonjr / dumb-telephone-input.html
Last active April 24, 2016 17:54
A really dumb telephone input inspired by https://i.imgur.com/C0H0fIX.jpg
<link rel="import" href="//polygit.org/components/polymer/polymer.html" />
<dom-module id="dumb-telephone-input">
<template>
<select id="area"></select>
<select id="prefix"></select>
<select id="phone"></select>
</template>
</dom-module>
<script>
@davidlwatsonjr
davidlwatsonjr / Remove Analytics Query Variables
Last active April 15, 2016 02:27
Remove analytics variables from the current page's query string. This allows for cleaner bookmarking, sharing, saving in Readability, etc. More analytics variables will added as they are found. This is minified as I use it as a bookmarklet.
(function() {
var r = ['utm_source', 'utm_campaign', 'utm_medium', 'utm_content', 'utm_hp_ref', 'wpisrc', 'xrs', 'fb_action_ids', 'fb_action_types', 'fb_source', 'action_object_map', 'mcid', 'rmid', 'rrid', 'CIMID'],
e = window.location.search.slice(1),
t = e.split('&'),
n = '?',
i = '';
e: for (p in t) {
for (var s = 0; s < r.length; s++) {
if (t[p].indexOf(r[s] + '=') === 0) {
break e
@davidlwatsonjr
davidlwatsonjr / hsl-clock.html
Last active March 28, 2016 20:54
HSL Clock web component
<script>
(function() {
var hslClock = Object.create(HTMLElement.prototype);
hslClock._hueTranslate = 0;
hslClock._saturationReverse = false;
hslClock._luminosityReverse= false;
hslClock._hideText = false;
Object.defineProperty(hslClock, 'hueTranslate', {
@davidlwatsonjr
davidlwatsonjr / feedlySubscribe.js
Last active December 19, 2015 23:29
Feedly Subscribe Bookmarklet
javascript: (function() {
function getProperHref(href) {
if (!href.match(/^http/)) {
var path = (href.match(/^\//)) ? '/' : location.pathname;
href = 'http://' + location.hostname + path + href;
}
return href;
}
var links = document.querySelectorAll('link[rel="alternate"][type^="application/"][type$="+xml"');
var feedlyURL = 'https://feedly.com/i/subscription/feed/';
var rerouteRandomEvent = function () {
var pickRandomEvent = function () {
var events = [
'click',
'keyup',
'mousedown'
];
return events[Math.floor(Math.random()*events.length)];
};