Skip to content

Instantly share code, notes, and snippets.

Avatar
😜
Howdy

Thomas Aylott subtleGradient

😜
Howdy
View GitHub Profile
View RemoteViewActivity.java
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;
View StickySidebar.tsx
import useSize, { UseSizeOptions } from "@react-hook/size";
import {
Fragment,
ReactNode,
RefObject,
useCallback,
useEffect,
useLayoutEffect,
useRef
} from "react";
@subtleGradient
subtleGradient / youtube-get-the-transcript-text.bookmarklet.js
Last active Feb 16, 2022
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
.querySelector("ytd-transcript-renderer")
.__data
.data
.body
.transcriptBodyRenderer
.cueGroups
@subtleGradient
subtleGradient / appify
Created Nov 11, 2010
appify. Create the simplest possible mac app from a shell script
View appify
#!/usr/bin/env bash
#
# url : https://gist.github.com/672684
# version : 2.0.2
# name : appify
# description : Create the simplest possible mac app from a shell script.
# usage : cat my-script.sh | appify MyApp
# platform : Mac OS X
# author : Thomas Aylott <oblivious@subtlegradient.com>
View 42_hand-sketch-97.info.markdown

This was drawn by the textmode artist agent_42 (member of the CiA art group) It was sketched in 1997 after the artist graduated from vocational school for Desktop Publishing, his mom forced him to take a drawing class.

This was the first thing he ever drew in class. Not too shabby right?

42_hand-sketch-97

View remove-wcostream-ads.bookmarklet.js
javascript:void(()=>[...document.querySelectorAll('.ui-block-a~script,.ui-block-a~center,.share,[data-role="content"][role="main"],[data-role="content"][role="main"]+.ui-grid-solo,.ui-block-a+div')].forEach(e=>e.parentNode.removeChild(e)))()
@subtleGradient
subtleGradient / command.js
Last active Aug 9, 2021 — forked from jonathantneal/command.js
Executable JavaScript Modules
View command.js
":" /*prettier-ignore*/ //#;exec /usr/bin/env node --input-type=module - "$@" < "$0"
import process from "process";
const { argv } = process;
console.log(argv);
View vtt.re
WEBVTT|(?<=^[A-Z][^.?!]+$)\n|^\d+.+align:center$| +|<[^>]+>|$\n\n
@subtleGradient
subtleGradient / setWindow.cypress.js
Last active Jul 6, 2021
Test multiple popup windows and iframes with Cypress, including window.open
View setWindow.cypress.js
/*
The MIT License
Copyright 2020 Thomas Aylott <oblivious@subtlegradient.com>
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF O
View DebugWebView.jxa.js.command
#!/usr/bin/env osascript -l JavaScript
// macOS JXA JavaScript for Automation
// eslint-disable-next-line @typescript-eslint/no-unused-vars
function run(argv) {
Application('Safari').activate();
const { Safari } = Application('System Events').applicationProcesses;
const { Develop } = Safari.menuBars[0].menuBarItems;