Skip to content

Instantly share code, notes, and snippets.

View thursby's full-sized avatar

Wayne Thursby thursby

View GitHub Profile
@thursby
thursby / Eleventy and NetlifyCMS.md
Last active June 30, 2019 01:02
Eleventy NetlifyCMS

Using Netlify CMS with Eleventy

This guide will help you get started with Netlify CMS and Eleventy. This will set up a very basic blog site and is intended as a demonstration of the concepts.

If you just want to get up and running quickly, a vastly superior site can be had in just a few seconds by using the Eleventy Netlify Boilerplate project. The Deploy to Netlify button does what it says, and quite literally couldn't be easier. This guide borrows heavily from that work, but is simplified for illustrative purposes.

Objectives

  • Create a functional website following the pattern of a blog.

  • The site should have Pages and Posts.

#!/usr/bin/python
# -*- coding: utf-8 -*-
import os.path
from googleapiclient.discovery import build
from google_auth_oauthlib.flow import InstalledAppFlow
from google.oauth2 import service_account
from google.auth.transport.requests import Request
SCOPES = ['https://www.googleapis.com/auth/spreadsheets']
@thursby
thursby / c9-cent7.md
Last active June 27, 2022 15:10
Install Cloud9 IDE under CentOS 7 with Let's Encrypt SSL

First, get a working CentOS 7 server with your preferred stack. Next, install requirements:

yum groupinstall -y development
yum install -y git glibc-static epel-release nodejs npm

Now clone the git repo and Install the Cloud9 SDK:

git clone https://github.com/c9/core.git c9sdk
cd c9sdk/
@thursby
thursby / gist:8ac6cb96c84b6d20a3fb1bf3048d46ed
Last active March 25, 2017 16:21
Set the sensitivity for the Logitech M570 in Linux. For whatever reason most controls won't let you set sensitivity less than 1. My trackball likes 0.4. The way this is set is weird because the IDs seem to change whenever the USB is connected and disconnected. I wrote this oneliner to find 'em and change it.
xinput list --short | grep Logitech | awk '{print $5}' | cut -f2 -d"=" | xargs -I id xinput set-prop id "Device Accel Constant Deceleration" 0.4
@thursby
thursby / wp-restore.sh
Last active August 28, 2016 15:54
wp-restore.sh is used in conjunction with wp-backup.sh to reinstall WordPress from known good sources
#!/bin/bash
source_dir=$1
wp_core_version=`cat "$source_dir/wp_version.txt"`
# Download and extract the WordPress core
wp core download --version=$wp_core_version
# Read the list of themes from the file we created earlier
@thursby
thursby / wp-backup.sh
Last active August 28, 2016 17:08
Back up the bare minimum from a WordPress installation -- useful when WordPress has been compromised
#!/bin/bash
# This uses the system's tmp directory, set a custom one with --tmpdir=/where/ever
tmp_dir=`mktemp -d`
echo Work Directory: $tmp_dir
files_to_keep=("wp-config.php" "wp-content/uploads")
for i in ${files_to_keep[@]}; do
echo "Copying ${i}"