Skip to content

Instantly share code, notes, and snippets.

@subtleGradient
subtleGradient / Docs as Wiki (tools) icon.png
Last active September 9, 2018 01:13
Google Docs script to Create new Document from selected text and then link selected text to that new document URL; Use Google Docs like a Wiki
Docs as Wiki (tools) icon.png
@subtleGradient
subtleGradient / youtube-get-the-transcript-text.bookmarklet.js
Last active February 16, 2022 20:17
JS Bookmarklet to Get the text content of any YouTube video that has a transcript!
javascript: void (()=>{
let text = null;
try {
text = document
.querySelector("ytd-transcript-renderer")
.__data
.data
.body
.transcriptBodyRenderer
.cueGroups
@subtleGradient
subtleGradient / gist:a158bd0a51edd2f449c5983e66317f5a
Last active December 14, 2018 16:47
GatsbyJS createPages TypeScript GraphQL syntax coloring fix
// Copyright (C) 2018 by Things That Do Stuff, LLC - All rights reversed
// http://www.unlicense.org/ (public domain)
const gql = (templateStringParts: TemplateStringsArray, ...vars: any[]): string =>
templateStringParts.map((part, index) => (index in vars ? part + JSON.stringify(vars[index]) : part)).join('');
export const createPages: GatsbyCreatePages = async ({ graphql, boundActionCreators }) => {
const query = gql`
{
site: contentfulSite(url: { eq: ${'thingsthatdostuff.com'} }) {
package com.subtlegradient.android.thinpushclient;
import java.io.File;
import java.lang.reflect.Method;
import android.annotation.TargetApi;
import android.app.Activity;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Canon\EOS Utility]
[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Canon\DPP]
[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Canon\ZoomBrowser EX]
[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Canon\PhotoStitch
[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Canon\EOS Capture]
[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Canon\EOSViewerUtility]
[HKEY_LOCAL_MACHINE\SOFTWARE\Canon\ZoomBrowser EX\Install]
[...$$('img')].map(img => {
const imageFilename = img.getAttribute('src');
const [type, ...name] = img.parentNode.parentNode.parentNode.parentNode.nextSibling.nextSibling.textContent.trim().split('\n').map(string=>string.trim()).reverse();
return `cp '${imageFilename}' '${name.reverse().join(' ')}.${imageFilename.split('.').reverse()[0]}'`;
}).join('\n')
Cypress.Commands.add('waitForAllAPIs', waitForAllAPIs);
let requestCount;
beforeEach(() => {
requestCount = 0;
cy.server({
onRequest() {
requestCount++;
@subtleGradient
subtleGradient / is-flow-fast.node.mjs
Last active October 4, 2019 17:12
git bisect script for checking if flow is slow
#!/usr/bin/env node --experimental-modules
/* eslint-disable no-console */
import { execSync } from 'child_process';
process.env.ROOT_VIEW_PATH = `src/common/components/views/RootView.js`;
const exec = script => {
console.log(`$ ${script}`);
@subtleGradient
subtleGradient / 512-op-whatever.js
Last active November 15, 2022 12:51
All 512 types! OP --
[...document.querySelectorAll('td img')]
.map((img) => [img, img.closest('td')])
.map(([img, td]) => [img, td.innerText || td.parentElement.nextElementSibling.cells[td.cellIndex].innerText])
.map(([img, text]) => [img.src, ...text.split(/\s+/).reverse()])
.map(([src, type, ...name]) => [type, name.reverse().join(' '), src])
javascript: (() => {
async function download(fileName, data) {
const content =
typeof data === "string" || data instanceof Blob
? data
: JSON.stringify(data);
const downloadURL = window.URL.createObjectURL(
new Blob([content], { type: "application/json" })
);
const anchor = document.createElement("a");