First let's install Homebrew.
$ /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
| /*/ | |
| Fetch Dreamhost Domain Info | |
| The Dreamhost API command domain-list_domains was retired on Nov 2nd 2021. This function is a makeshift replacement for that. | |
| Usage: | |
| 1. Log into your Dreamhost account and click Domains / Manage Domains | |
| 2. Paste this entire gist into the console | |
| 3. Press enter and wait for "sites.json" to be downloaded | |
| Let me know if this helps anyone else or if you have any suggestions. |
| const pw = require('playwright'); | |
| const UserAgent = require('user-agents'); | |
| const uuid = require('uuid'); | |
| const tmp = require('tmp-promise'); | |
| const UINT32_MAX = (2 ** 32) - 1; | |
| const WEBGL_RENDERERS = ['ANGLE (NVIDIA Quadro 2000M Direct3D11 vs_5_0 ps_5_0)', 'ANGLE (NVIDIA Quadro K420 Direct3D9Ex vs_3_0 ps_3_0)', 'ANGLE (NVIDIA Quadro 2000M Direct3D9Ex vs_3_0 ps_3_0)', 'ANGLE (NVIDIA Quadro K2000M Direct3D11 vs_5_0 ps_5_0)', 'ANGLE (Intel(R) HD Graphics Direct3D9Ex vs_3_0 ps_3_0)', 'ANGLE (Intel(R) HD Graphics Family Direct3D9Ex vs_3_0 ps_3_0)', 'ANGLE (ATI Radeon HD 3800 Series Direct3D9Ex vs_3_0 ps_3_0)', 'ANGLE (Intel(R) HD Graphics 4000 Direct3D11 vs_5_0 ps_5_0)', 'ANGLE (Intel(R) HD Graphics 4000 Direct3D11 vs_5_0 ps_5_0)', 'ANGLE (AMD Radeon R9 200 Series Direct3D11 vs_5_0 ps_5_0)', 'ANGLE (Intel(R) HD Graphics Direct3D9Ex vs_3_0 ps_3_0)', 'ANGLE (Intel(R) HD Graphics Family Direct3D9Ex vs_3_0 ps_3_0)', 'ANGLE (Intel(R) HD Graphics Direct3D9Ex vs_3_0 ps_3_0)', 'ANGLE (Intel(R) HD Graphics Family Direct3D |
| const echoPostRequest = { | |
| url: 'https://<my url>.auth0.com/oauth/token', | |
| method: 'POST', | |
| header: 'Content-Type:application/json', | |
| body: { | |
| mode: 'application/json', | |
| raw: JSON.stringify( | |
| { | |
| client_id:'<your client ID>', | |
| client_secret:'<your client secret>', |
| /**************************************************************** | |
| ARCHIVED - NOT MAINTAINED | |
| If you want to use this script (or one like it), please use the | |
| maintained version here: | |
| https://github.com/jakerella/jqes6/blob/master/jqes6.js | |
| ****************************************************************/ | |
| (function() { | |
| 'use strict'; |
| // domains to check | |
| var checkDomains = ['www.foobar.com', 'www.fubar.com']; | |
| // check all links in DOM for matching domain(s) | |
| var matchingLinks = []; | |
| var documentLinks = document.links; | |
| for (var i = 0; i < documentLinks.length; i++) { | |
| if (checkDomains.indexOf(documentLinks[i].hostname) > -1) | |
| matchingLinks.push(documentLinks[i]); | |
| } |
| /* | |
| * Ensure the http protocol is always used on the myshopify.com domains. | |
| * Uses liquid to input the correct URL. | |
| */ | |
| if (window.location.href.match(/https:\/\/.*.myshopify.com/) && top === self) { | |
| window.location.href = window.location.href.replace(/https:\/\/.*.myshopify.com/, 'http://{{ shop.domain }}'); | |
| } |
| /* bling.js */ | |
| window.$ = document.querySelector.bind(document); | |
| window.$$ = document.querySelectorAll.bind(document); | |
| Node.prototype.on = window.on = function(name, fn) { this.addEventListener(name, fn); }; | |
| NodeList.prototype.__proto__ = Array.prototype; | |
| NodeList.prototype.on = function(name, fn) { this.forEach((elem) => elem.on(name, fn)); }; |
| #!/bin/bash | |
| # | |
| # Example using getopt (vs builtin getopts) that can also handle long options. | |
| # Another clean example can be found at: | |
| # http://www.bahmanm.com/blogs/command-line-options-how-to-parse-in-bash-using-getopt | |
| # | |
| aflag=n | |
| bflag=n |