Skip to content

Instantly share code, notes, and snippets.

View aciccarello's full-sized avatar

Anthony Ciccarello aciccarello

View GitHub Profile
@aciccarello
aciccarello / screenshot-wordle-board.js
Created January 29, 2024 00:49
Wordle guess screenshot
// Get a screenshot of the wordle board and open in a new tab. Run from the dev tools.
import('https://html2canvas.hertzen.com/dist/html2canvas.esm.js')
.then((html2canvas) => html2canvas.default(document.querySelector("[class^='Board-module_board__']")))
.then((canvas) => window.open(canvas.toDataURL("image/png")));
@aciccarello
aciccarello / Set playback Rate.js
Created January 5, 2021 05:42
Set audio/video playback
function setPlaybackRate(rate) {
Array.from(document.querySelectorAll('video,audio')).forEach((v) => v.playbackRate = rate);
}
// Mutation observer for interactive UIs
// Select the node that will be observed for mutations
let targetNode = document.body;
// Options for the observer (which mutations to observe)
let config = { attributes: true, childList: true, subtree: true };
@aciccarello
aciccarello / README.md
Last active August 1, 2019 09:35
My Vim Guide
@aciccarello
aciccarello / mint-month-transactions-bookmarklet.js
Created September 7, 2018 21:33
Mint Bookmarklet to load transactions in month
javascript:
(function() {
var month = prompt('Month');
var year = new Date().getFullYear();
var yearInput = prompt(`Year (default ${year})`);
year = yearInput ? '20' + yearInput : (new Date().getFullYear());
var lastDayOfMonth = new Date(Number(year), Number(month), 0).getDate();
window.location.href = `https://mint.intuit.com/transaction.event?startDate=${month}/01/${year}&endDate=${month}/${lastDayOfMonth}/${year}&exclHidden=T`;
@aciccarello
aciccarello / RouteConfig.ts
Last active June 3, 2016 06:03
Created as a proof of concept for a decorator that attaches the state config to a controller class and a factory for registering route configs from the class.
/**
* Decorator for controller classes for route states. You can reference the class in the
* `controller` property. Name is a required property on the config if using the
* registerState helper.
* @return Function which takes a UI Router config object.
*/
export default RouteConfig(target) {
return function(config) {
target.$uiRouteConfig = config;
}