This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| type Console = typeof console | |
| /** | |
| * This class' sole purpose is to avoid cluttering the codebase with `eslint-disable-line no-console` comments | |
| * | |
| * When using this class to log errors or messages, one can assume it's intentional and principled. | |
| */ | |
| class Log { | |
| constructor (private readonly namespace?: string) {} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # | |
| ## | |
| ### PUBLIC INTERFACE | |
| ## | |
| # | |
| # Set up ipfs-chat | |
| function chat-setup() { | |
| # Create folders | |
| mkdir -p $(chat-prefix) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * Modified by Russell Dempsey on 2021 DEC 15 | |
| * @see https://stackoverflow.com/a/62002044/592760 | |
| */ | |
| type Subscriber<T> = (value: T) => void; | |
| class Observable<T> { | |
| private subscribers = new Set<Subscriber<T>>(); | |
| constructor(private value: T) {} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // ==UserScript== | |
| // @name Add Saved Items to Cart | |
| // @namespace https://gist.github.com/beporter/ce76204bcba35d9edb66b395bb5e9305 | |
| // @version 0.5 | |
| // @description Repeatedly refresh a given "saved items" page (Amazon, Walmart, BestBuy), look for specific "Add to Cart" buttons, click them if present, and make a lot of noise on success. | |
| // @author https://github.com/beporter | |
| // @match https://www.amazon.com/gp/registry/wishlist/* | |
| // @match https://www.amazon.com/hz/wishlist/ls/* | |
| // @match https://www.bestbuy.com/cart | |
| // @match https://www.bestbuy.com/site/customer/lists/manage/saveditems |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <meta charset="utf-8" /> | |
| <title>HTML Table to Markdown Extra Table</title> | |
| <style type="text/css"> | |
| * { -moz-box-sizing: border-box; -webkit-box-sizing: border-box; box-sizing: border-box;} | |
| body { font-family: -apple-system, "Segoe UI", Arial, Helvetica, sans-serif; line-height: 1.5; | |
| text-rendering: optimizeLegibility; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; } | |
| textarea { width: 100%; height: 15em; } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // does not work... | |
| var tar = require('tar'); | |
| var fstream = require('fstream'); | |
| var input = `node_modules`; | |
| var reader = fstream.Reader({type: "Directory", path: input}); | |
| var pack = tar.Pack(); | |
| reader.pipe(pack).pipe(tar.Extract({path: '/tmp/destination-node-tar'})); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| MyElement | |
| Hover | |
| HStill | |
| HMoving | |
| onMouseOut -> MouseOutside | |
| onMouseMove -> HMoving | |
| onMouseStop -> HStill | |
| MouseOutside* | |
| onMouseEnter -> HMoving |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const glob = require('glob'); | |
| const globPromise = (string) => new Promise((resolve, reject) => { | |
| glob(string, (error, result) => { | |
| if (error) { | |
| reject(error); | |
| } | |
| resolve(result); | |
| }); | |
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const glob = require('glob'); | |
| const globPromise = (string) => new Promise((resolve, reject) => { | |
| glob(string, (error, result) => { | |
| if (error) { | |
| reject(error); | |
| } | |
| resolve(result); | |
| }); | |
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #TabsToolbar { | |
| visibility: collapse !important; | |
| } | |
| #main-window[tabsintitlebar]:not([sizemode="fullscreen"]) #TabsToolbar:not([collapsed="true"]) + #nav-bar:not(:-moz-lwtheme) { | |
| background-clip: padding-box; | |
| position: relative; | |
| z-index: 1; | |
| padding-left: 67px; | |
| } |