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 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>', |
(function() { | |
'use strict'; | |
/** | |
* Core method, similar to jQuery (only simpler) | |
* | |
* @param {String|HTMLElement} s The CSS selector to search for or HTML element to wrap with functionality | |
* @param {HTMLElement} root OPTIONAL An HTML element to start the element query from | |
* @return {Array} The collection of elements, wrapped with functionality (see API methods) | |
*/ |
// 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.querySelectorAll.bind(document); | |
Node.prototype.on = window.on = function (name, fn) { | |
this.addEventListener(name, fn); | |
} | |
NodeList.prototype.__proto__ = Array.prototype; |
#!/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 |
// based on https://gist.github.com/Potfur/5576225 & https://github.com/james2doyle/saltjs | |
// more info: https://plus.google.com/109231487156400680487/posts/63eZzzrBSb6 | |
window.$ = function(s) { | |
var c = { | |
'#': 'ById', | |
'.': 'sByClassName', | |
'@': 'sByName', | |
'=': 'sByTagName'}[s[0]]; | |
return document[c?'getElement'+c:'querySelectorAll'](s.slice(1)) | |
}; |