Skip to content

Instantly share code, notes, and snippets.

@jackmcdade
jackmcdade / globals.yaml
Created July 3, 2019 16:33
Statamic Fieldset for Head and Footer Scripts
title: 'Site Settings'
hide: true
sections:
main:
fields:
head_scripts:
mode: table
fields:
description:
type: text
@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.
@mattpwest
mattpwest / control.ubuntu.sh
Last active September 2, 2021 07:59
Vagrant - Ubuntu 18.04: Provision Ansible with Python 3
if [ ! -f "/home/vagrant/.ssh/id_rsa" ]; then
ssh-keygen -t rsa -N "" -f /home/vagrant/.ssh/id_rsa
fi
cp /home/vagrant/.ssh/id_rsa.pub /vagrant/control.pub
cat << 'SSHEOF' > /home/vagrant/.ssh/config
Host *
StrictHostKeyChecking no
UserKnownHostsFile=/dev/null
@jackmcdade
jackmcdade / gist:ff8bf61fb57db5e74edd8a7b9b5a2b26
Last active February 2, 2021 09:34
Instagrizzle Scraper
// Quick and dirty Instagram scraper
private function scrape($username)
{
$source = file_get_contents('http://instagram.com/' . $username);
$shards = explode('window._sharedData = ', $source);
$json_response = explode(';</script>', $shards[1]);
$response_array = json_decode($json_response[0], TRUE);
$nodes = array_get($response_array, 'entry_data:ProfilePage:0:user:media:nodes');
$data = array();
@avataru
avataru / EloquentCheatSheet.md
Last active April 5, 2024 20:39
Eloquent relationships cheat sheet
@jackmcdade
jackmcdade / feed.html
Created May 8, 2017 13:37
Statamic RSS Feed
{{ xml_header }}
<rss version="2.0">
<channel>
{{ get_content from="/blog" }}
<title>{{ title | cdata }}</title>
<link>{{ site_url }}</link>
<description>{{ content | cdata }}</description>
{{ /get_content }}
<lastBuildDate>{{ collection:blog limit="1" }}{{ date format="r" }}{{ /collection:blog }}</lastBuildDate>
<language>en-us</language>
@harryfinn
harryfinn / letsencrypt-wordpress-setup.md
Last active November 12, 2023 10:21
Instructions on how to setup a Letsencrypt SSL certificate on a WordPress site

Letsencrypt (for WordPress sites)

Note: This setup assumes you are running Ubuntu 16.04 OS with Apache 2.4.23, older versions of Ubuntu (i.e. 14.04) require minor configuration changes in order for this setup to work.

Setup

Follow the install instructions for certbot (letsencrypt's SSL manager) on https://certbot.eff.org/, making sure to select the correct server OS version.

Note: You only need to complete the Install section, then return to this README in order to setup your SSL

@mircobabini
mircobabini / woocommerce-edits.php
Last active July 30, 2019 19:50
woocommerce useful actions
<?php
/**
* @author Mirco Babini, SED Web Italia
*
* Contents:
* - reset payment method on 'add to cart'
* - add message to (customer) email per payment method
* - add payment method to email
* - remove product tabs
* - remove result count and default ordering (doesnt work?)
@trey
trey / happy_git_on_osx.md
Last active February 18, 2024 10:46
Creating a Happy Git Environment on OS X

Creating a Happy Git Environment on OS X

Step 1: Install Git

brew install git bash-completion

Configure things:

git config --global user.name "Your Name"

git config --global user.email "you@example.com"