Skip to content

Instantly share code, notes, and snippets.

View fastzen's full-sized avatar

Alastair fastzen

  • Salt Spring Island, BC
View GitHub Profile
@fastzen
fastzen / gist:f8b31406cc28c73234a023fdc8dec9f4
Created August 28, 2016 18:05
Raspberry Pi LCD display is upside down on OpenELEC
mount -o remount,rw /flash
vi /flash/config.txt
Add:
lcd_rotate=2
Save changes
mount -o remount,ro /flash
@fastzen
fastzen / gist:ac2dd8d29b456fa6e0b927815f92534a
Created August 30, 2016 15:48
ImageMagick - convert image with transparency to greyscale, resize to specific height
convert image.png -type grayscalematte grayscale_image.png
convert image.png -resize x123 -gravity center image-resize.png
@fastzen
fastzen / flatten.rb
Created August 30, 2016 18:23
flatten
#!/usr/bin/env ruby
# encoding: utf-8
require "test/unit"
# Flatten an array given any nesting depth
def flatten(array, result = [])
return result unless array.is_a?(Array)
array.each do |element|
@fastzen
fastzen / gist:ba8143b16a1e0e7127c07742b7416f78
Created September 2, 2016 01:56
Installing OpenVPN on Lubuntu
sudo apt-get install network-manager-openvpn
sudo apt-get install network-manager-openvpn-gnome
@fastzen
fastzen / gist:39714fd506d6353fb14777639b8a877f
Created September 3, 2016 00:21
Verbose SSH login test, force specific public key
ssh -i ~/.ssh/other_id_rsa.pub -vvv git@github.com
@fastzen
fastzen / README.md
Created October 5, 2016 22:25
Create a rough-and-ready PouchDB Dash docset
wp core download --path=wpclidemo
cd wpclidemo
wp core config --dbname=wpclidemo --dbuser=root --dbpass=password
wp db create
# The following installs correctly but reports an error when attempting to connect to SMTP
wp core install --url=wpclidemo.dev --title="WP-CLI" --admin_user=wpcli --admin_password=wpcli --admin_email=info@wp-cli.org
@fastzen
fastzen / composer.json
Created January 24, 2017 01:13
Example for adding composer to WordPress
{ "name": "fastzen/wpdemo", "description": "Getting started with WordPress and Composer", "license": "MIT", "repositories": [ { "type":"composer", "url":"https://wpackagist.org" } ], "require": { "composer/installers": "~1.0", "mohiohio/graphql-wp": "~0.3.1" }, "extra": { "installer-paths": { "wp-content/plugins/{$name}": ["type:wordpress-plugin"], "wp-content/themes/{$name}": ["type:wordpress-theme"], "wp-content/mu-plugins/{$name}": ["type:wordpress-muplugin"] } }}
@fastzen
fastzen / dumpyaml.php
Created February 6, 2017 04:53
Dump A MySQL Database To YAML Using PHP
<?php
/* ========================================================
* File           : dumpyaml.php
* Date           : July 15, 2010
* Author         : Jonathan Franzone
* Author Website : http://www.franzone.com
*
* Script to generate YAML (http://www.yaml.org/) from
* a MySQL database. Will generate YAML for either all
* tables in the specified database, only the specified
@fastzen
fastzen / untitled
Created February 10, 2017 05:40
WordPress plugin sections
/*
1. HOOKS
2. SHORTCODES
3. FILTERS
4. EXTERNAL SCRIPTS
5. ACTIONS
6. HELPERS
7. CUSTOM POST TYPES
8. ADMIN PAGES