Skip to content

Instantly share code, notes, and snippets.

@phillcoxon
phillcoxon / download_private_github_release.sh
Created November 3, 2019 01:04 — forked from josh-padnick/download.sh
Download a private binary release file from GitHub in bash
#!/usr/bin/env bash
#
# This is an adaptation of code I wrote to download a private binary from GitHub. Such...pain.
# Why can't GitHub just offer a standardized URL you can download a release binary from and attach
# your Github Personal Access Token as a header?
#
# Since this code is an adaptation it hasn't been directly tested, but the code it was adapted from works
# and hopefully you can get the missing piece you're after by looking here.
#
@phillcoxon
phillcoxon / Advanced Options Settings
Created April 23, 2018 18:39 — forked from lukecav/Advanced Options Settings (Improved)
MainWP Dashboard - Advanced Options (Performance)
Cross IP Settings
Maximum simultaneous requests 0 Default: 4
Minimum delay between requests (milliseconds) 100 Default: 200
IP Settings
Maximum simultaneous requests per ip 0 Default: 1
Minimum delay between requests to the same ip (milliseconds) 200 Default: 1000
Frontend request Settings
Maximum simultaneous sync requests 12 Default: 8
@phillcoxon
phillcoxon / functions.php
Created August 2, 2017 05:29 — forked from TimBHowe/functions.php
WooCommerce - Add custom post_meta data to the order REST API response.
<?php
/**
* Hook into order API response to add custom field data.
*
* @param $order_data array
* @param $order WC_Order
* @param $fields array
* @param $server array
*
@phillcoxon
phillcoxon / wordmove_with_localbyflywheel.sh
Last active March 7, 2019 00:53 — forked from k4zuki02h4t4/wordmove_with_localbyflywheel.sh
Enable Wordmove with "Local by Flywheel".
#!/usr/bin/env bash
set -xu
RUBY_VERSION=2.4.1
LIBSSL_VERSION=$(dpkg -s libssl1.0.0 | grep -i ^version | awk '{print $2;}')
apt-get update -y
apt-get upgrade -y
apt-get install -y git ssh-pass
@phillcoxon
phillcoxon / stream_to_youtube.sh
Created April 23, 2017 20:19 — forked from olasd/stream_to_youtube.sh
Stream video to youtube via ffmpeg
#! /bin/bash
#
# Diffusion youtube avec ffmpeg
# Configurer youtube avec une résolution 720p. La vidéo n'est pas scalée.
VBR="2500k" # Bitrate de la vidéo en sortie
FPS="30" # FPS de la vidéo en sortie
QUAL="medium" # Preset de qualité FFMPEG
YOUTUBE_URL="rtmp://a.rtmp.youtube.com/live2" # URL de base RTMP youtube
@phillcoxon
phillcoxon / backup.sh
Created November 1, 2016 11:20 — forked from bradt/backup.sh
Simple WordPress Backups v2
#!/bin/bash
NOW=$(date +%Y%m%d%H%M%S)
SQL_FILE=${NOW}_database.sql
# Backup database
wp db export ../backups/$SQL_FILE --add-drop-table
# Compress the database file
gzip ../backups/$SQL_FILE
@phillcoxon
phillcoxon / Contract Killer 3.md
Created June 19, 2016 00:00 — forked from malarkey/Contract Killer 3.md
The latest version of my ‘killer contract’ for web designers and developers

Contract Killer

The popular open-source contract for web professionals by Stuff & Nonsense

  • Originally published: 23rd December 2008
  • Revised date: March 15th 2016
  • Original post

tmux cheatsheet

As configured in my dotfiles.

start new:

tmux

start new with session name:

How-To: Install Memcache on CentOS (WHM/cPanel)

Without wasting much time, Let us get started!

Follow these simple instructions:

  • Step 1: Login into your WHM panel and using easyapache enable Memcache

  • Step 2: SSH into your server and fire this command yum install memcached.x86_64 php-pecl-memcache.x86_64

<?php
// Warning: this will overwrite every post in your database
// BACKUP FIRST!
clean_post_content();
function clean_post_content() {
$posts = get_posts(array(
'post_type' => array('post'), // or page, or cpt
'post_status' => 'publish', // or any, draft, etc