Skip to content

Instantly share code, notes, and snippets.

const sanityClient = require('@sanity/client');
const crypto = require('crypto');
const {
SANITY_API_TOKEN,
SANITY_PROJECT_ID,
SANITY_DATASET,
SHOPIFY_SECRET
} = process.env;
@robhrt7
robhrt7 / MySQL_5-7_macOS.md
Last active February 28, 2024 03:48 — forked from nrollr/MySQL_macOS_Sierra.md
Install MySQL 5.7 on macOS using Homebrew

This is a fork of original gist https://gist.github.com/nrollr/3f57fc15ded7dddddcc4e82fe137b58e, with slight changes on pointing to 5.7 version branch, instead of 8 (latest default of MySQL in Hombrew).

Install MySQL 5.7 on macOS

This procedure explains how to install MySQL using Homebrew on macOS (Sierra 10.12 and up)

Install Homebrew

  • Installing Homebrew is effortless, open Terminal and enter :
    $ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
  • Note: Homebrew will download and install Command Line Tools for Xcode 8.0 as part of the installation process.
@itsMattShull
itsMattShull / create-ssl-for-localhost
Created June 26, 2018 03:33
Command to create a key.pem and cert.pem for localhost
openssl req \
-newkey rsa:2048 \
-x509 \
-nodes \
-keyout key.pem \
-new \
-out cert.pem \
-subj /CN=localhost \
-reqexts SAN \
-extensions SAN \
@benmccallum
benmccallum / _Instructions.md
Last active July 25, 2021 03:35
nuxtjs, bootstrap-vue with custom bootstrap build

Important! This guide is out of date (circa 2017) and should no longer be used. For the latest advice, please refer to the BootstrapVue docs and their Nuxt.js module. https://bootstrap-vue.org/docs#nuxt-js

General setup:

  1. Install bootstrap as a dev dependency, and its dependencies (node-sass and sass-loader) npm install --save-dev bootstrap@4.0.0-beta.2 node-sass sass-loader
@jwhulette
jwhulette / .htaccess
Last active July 25, 2021 23:03
[A base .htaccess with HTTPS redirect behind an AWS Load Balancer] #apache #aws
<IfModule mod_rewrite.c>
<IfModule mod_negotiation.c>
Options -MultiViews
</IfModule>
RewriteEngine On
# Force HTTPS - Proto needed for AWS ELB
RewriteCond %{HTTP:X-Forwarded-Proto} !https
RewriteCond %{HTTP_USER_AGENT} !^ELB-HealthChecker
@cjmosure
cjmosure / functions.php
Last active June 12, 2019 10:11
WP-PageNavi - Bootstrap 4
<?php
/**
* Clean up pagination
*/
add_filter( 'wp_pagenavi', __NAMESPACE__ . '\\gc_pagination', 10, 2 );
function gc_pagination($html) {
$out = '';
$out = str_replace('<div','',$html);
$out = str_replace('class=\'wp-pagenavi\'>','',$out);
@martinsanne
martinsanne / gist:72f48bad22d99032ba0e
Created January 30, 2015 14:51
WordPress ACF Multisite location rule
<?php
/**
*
* Adds location rule to target specific sites in a WordPress Multisite environment
* http://www.advancedcustomfields.com/resources/custom-location-rules/
*
*/
function acf_location_rule_type_blog( $choices ) {
@tegansnyder
tegansnyder / Magento Admin Backend.md
Last active January 15, 2021 12:51
Magento Custom Admin Backend

You can set your own custom Magento admin URL in:

System -> Configuration -> [ADVANCED] -> Admin -> Admin Base URL

NOTE: Make sure you have added a ServerAlias directive to your virtual host configuration for backend.domain.com and that you have a SSL cert or wildcart setup for HTTPS traffic on that subdomain or you will lock yourself out the admin.

Rules for your .htaccess file to prevent duplicate urls and redirect directly to admin dashboard:

@kkirsche
kkirsche / Install Composer to use MAMP's PHP.md
Last active January 30, 2024 02:30
How to install Composer globally using MAMP's PHP

##Create an alias to MAMP's PHP installation

To do this, we can simply create an alias for our bash profile. We'll be doing this is nano, though you can do it in vim or a number of other editors as well.

Within the terminal, run:

nano ~/.bash_profile

This will open nano with the contents, at the top in a blank line add the following line:

@ksafranski
ksafranski / SimpleStore.js
Last active July 2, 2022 15:25
Simple localStorage function with Cookie fallback for older browsers.
/**
* Simple localStorage with Cookie Fallback
* v.1.0.0
*
* USAGE:
* ----------------------------------------
* Set New / Modify:
* store('my_key', 'some_value');
*
* Retrieve: