Skip to content

Instantly share code, notes, and snippets.


Thomas Aylott subtleGradient

Block or report user

Report or block subtleGradient

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View 512-op-whatever.js
[...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,]) => [type, name.reverse().join(' '), src])
subtleGradient / is-flow-fast.node.mjs
Last active Oct 4, 2019
git bisect script for checking if flow is slow
View is-flow-fast.node.mjs
#!/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}`);
View waitForAllAPIs.cypress.js
Cypress.Commands.add('waitForAllAPIs', waitForAllAPIs);
let requestCount;
beforeEach(() => {
requestCount = 0;
onRequest() {
View op-img-extract.console.js
[...$$('img')].map(img => {
const imageFilename = img.getAttribute('src');
const [type,] = 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]}'`;
View CanonUpdate.reg
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Canon\ZoomBrowser EX]
import java.lang.reflect.Method;
import android.annotation.TargetApi;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
subtleGradient / gist:a158bd0a51edd2f449c5983e66317f5a
Last active Dec 14, 2018
GatsbyJS createPages TypeScript GraphQL syntax coloring fix
View gist:a158bd0a51edd2f449c5983e66317f5a
// Copyright (C) 2018 by Things That Do Stuff, LLC - All rights reversed
// (public domain)
const gql = (templateStringParts: TemplateStringsArray, ...vars: any[]): string =>, 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: ${''} }) {
subtleGradient / youtube-get-the-transcript-text.bookmarklet.js
Last active May 1, 2019
JS Bookmarklet to Get the text content of any YouTube video that has a transcript!
View youtube-get-the-transcript-text.bookmarklet.js
javascript: void (()=>{
let text = null;
try {
text = document
subtleGradient / Docs as Wiki (tools) icon.png
Last active Sep 9, 2018
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
View khanacademy-bouncy-hat.js
var hatY = 0;
var HATY_MAX = 106;
var defaultSpringState = {
enabled: true,
mass: 10,
friction: 3,
stiffness: 120 / 100,
You can’t perform that action at this time.