Skip to content

Instantly share code, notes, and snippets.

Jupitercow jupitercow

Block or report user

Report or block jupitercow

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@jupitercow
jupitercow / squarespace-age-gate.js
Last active Apr 8, 2019
Squarespace Age Gate. Add this code just to the Age Gate page. This is usually a "Cover Page" under Pages > Not Linked. Click the gear icon, go to Advanced tab in the popup, paste this code. This sets the cookie and handles the redirect back to the requested content.
View squarespace-age-gate.js
<script>
/**
* Anonymous function that obtains the parameters passed in the url.
* The returned value is stored in the variable QueryString.
* To obtain a parameter "name1", we have to call "QueryString.name1"
*/
var QueryString = function() {
var query_string = {};
var query = window.location.search.substring(1);
var vars = query.split("&");
@jupitercow
jupitercow / squarespace-age-gate-global.js
Last active Feb 12, 2017
Squarespace Age Gate. Add this code globally: Settings > Advanced > Code Injection. Your "Age Gate" page needs the slug of "age-gate", or you need to edit that in the code (2 places).
View squarespace-age-gate-global.js
<script>
var cookies;
/**
* Returns the value of the cookie name.
* @param {string} name
* @returns {string}
*/
function readCookie(name,c,C,i){
if (cookies && cookies[name]) { return cookies[name]; }
View Add a Github Plugin to the WordPress.org Repository
# Checkout the repository from .org (must use “https”!)
svn co https://plugins.svn.wordpress.org/sewn-in-xml-sitemap .
# Change directory to the trunk
cd trunk
# Clone the plugin files from Github
git clone git@github.com:jupitercow/sewn-in-xml-sitemap.git .
# Change back to parent directory
cd ../
You can’t perform that action at this time.