Skip to content

Instantly share code, notes, and snippets.

View waynegraham's full-sized avatar

Wayne Graham waynegraham

View GitHub Profile
#!/usr/bin/env bash
faces=('ಠ_ಠ' 'ಠ_ರೃ' '﴾͡๏̯͡๏﴿' '๏_๏' 'ಠ▃ಠ' '(•‿•)' 'Ծ_Ծ' '¯\(°_o)/¯' '(✌゚∀゚)☞' '╚(•⌂•)╝' 't(-_-t)t' '(ツ)_/¯' '◔_◔' '◎⃝ _◎⃝' ';ლ(ಠ_ಠლ)' '(╯°□°)╯︵ ┻━┻' 'ᶘ ᵒᴥᵒᶅ')
if [[ -z $1 ]]; then
echo 'Choose a face and | it to pbcopy'
i=0
for f in ${faces[@]}
do
echo $i $f
i=`expr $i + 1`
@waynegraham
waynegraham / Rakefile
Last active March 7, 2017 13:26
NetForum to MemberSuite org matches with lookup
require 'csv'
desc 'Map MemberSuite and NetForum data'
task map: :combine do
membersuite_data = CSV.table('membersuite.csv', headers: true)
# netforum_data = CSV.table('netforum-combined.csv', headers: true)
report_path = 'membsuite-mapping.csv'
headers = %w(organization membersuite_id netforum_id)
CSV.open(report_path, 'w') do |csv|
csv << headers
@waynegraham
waynegraham / wordpress_theme_deploy.md
Last active June 23, 2021 17:35
Deploy wordpress theme via git

Deploying WordPress Theme via Git

I needed to deploy a child theme to a server for folks to check out the development. I went with a git remote to get the good stuff from git to quickly recover if (when) I break something.

Server Setup

On the server, I created a new directory:

$ sudo mkdir -p /var/repos/theme_name.git
@waynegraham
waynegraham / import_full_rss.rb
Created January 10, 2017 15:09
Import the full RSS feed in to Jekyll (from WordPress)
#! /usr/bin/env ruby
require 'rss'
require 'rss/2.0'
require 'open-uri'
require 'fileutils'
require 'safe_yaml'
url = 'https://www.diglib.org/topics/ndsa/feed/'
@waynegraham
waynegraham / gist:a43a2633155992718c7ce181670144cd
Created December 8, 2016 15:01
Find and replace style and class strings
(style|class)="([^"]*)"
http(s)?://www.clir.org/
@waynegraham
waynegraham / notes.md
Last active September 30, 2017 00:08
@waynegraham
waynegraham / notes.md
Created October 31, 2016 17:47
Issue with WP Missed Schedule

The cron jobs weren't running for delaying the schedule. While not necessary, the WP Missed Schedule plugin was being used. After a bit of digging, I noticed this plugin was slightly out of date (the developer apparently took the plugin out of the WP repo so you need to install it from the GitHub repo).

This plugin also requires WP Control as a dependency. This component was missing, so I suspect that in some previous update this got missed causing posts to not get published.

We should look at if we really need this; PHP cron has come quite a ways since this plugin was needed. This was really a plugin to fix a bug in WordPress 2.5 (and stayed there for a while).

@waynegraham
waynegraham / notes.md
Created October 31, 2016 17:22
Replace Cufon font in construct theme

On the server, edit ~/domains/diglib.org/wp-content/themes/construct/diglib.css (it's also in ~/domains/diglib.org/wp-content/themes/diglib-construct/diglib.css, but it doesn't get used).

Add an @import for the proper Font from Google Fonts.

@import url('https://fonts.googleapis.com/css?family=Varela');

Then update the font:

@waynegraham
waynegraham / mail.log
Last active September 16, 2016 19:49
Code snippets for Un-subscription Kerfuffle
5.7.1 550-5.7.1 [2600:3c03::f03c:91ff:fe55:a961] Our system has detected that this
550-5.7.1 message does not meet IPv6 sending guidelines regarding PTR records
550-5.7.1 and authentication. Please review 550-5.7.1
https://support.google.com/mail/?p=IPv6AuthError for more information 550 5.7.1 .
g67si1934521qkd.67 - gsmtp
@waynegraham
waynegraham / instructions.md
Created September 12, 2016 16:08
Migrate Wordpress Site to Multisite
  • Create a dump of the mysql database being migrated (e.g. diglib) with mysqldump or wp-cli
$ cd path/to/wordpress-to-migrate
$ wp export ~/wordpress-`date +%Y-%m-%d`.sql
  • Edit the file to replace the the table prefix with the prefix and id used in the WPMU instance. This is the regex in vim: