Skip to content

Instantly share code, notes, and snippets.

🏠
Working from home

Ashley Rich A5hleyRich

🏠
Working from home
Block or report user

Report or block A5hleyRich

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@A5hleyRich
A5hleyRich / index.html
Created Oct 23, 2018
Sample back soon page.
View index.html
<!doctype html>
<html>
<head>
<title>Back Soon</title>
<style>
body { text-align: center; padding: 150px; }
h1 { font-size: 50px; }
body { background-color: #e13067; font: 20px Helvetica, sans-serif; color: #fff; line-height: 1.5 }
article { display: block; width: 650px; margin: 0 auto; }
</style>
View find-replace.php
$post_content_sql = "UPDATE $wpdb->posts SET `post_content` = replace(post_content, '{$pair['old_url']}', '{$pair['new_url']}'){$where_sql};";
$meta_content_sql = "UPDATE $wpdb->postmeta SET `meta_value` = replace(meta_value, '{$pair['old_url']}', '{$pair['new_url']}') WHERE `meta_key` IN ('tve_content_before_more', 'tve_save_post', 'tve_updated_post');";
// run the sql
$wpdb->query( $post_content_sql );
$wpdb->query( $meta_content_sql );
View gist:8f4ae814e5edb4b919e1
Verifying that +a5hleyrich is my blockchain ID. https://onename.com/a5hleyrich
@A5hleyRich
A5hleyRich / ashleyrich.com
Last active Feb 15, 2017
Hosting WordPress Yourself Part 7
View ashleyrich.com
fastcgi_cache_path /home/ashley/ashleyrich.com/cache levels=1:2 keys_zone=ashleyrich.com:100m inactive=60m;
server {
listen 443 ssl http2;
listen [::]:443 ssl http2;
server_name pluto.ashleyrich.com;
ssl_certificate /etc/letsencrypt/live/pluto.ashleyrich.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/pluto.ashleyrich.com/privkey.pem;
@A5hleyRich
A5hleyRich / add.php
Last active Sep 11, 2015
Delightful Downloads Custom Outputs
View add.php
<?php
function dedo_custom_output( $styles ) {
$styles['icon_link'] = array(
'name' => __( 'Icon Link', 'delightful-downloads' ),
'format' => '<div class="download_container"><i class="fa fa-download"></i><a href="%url%" title="%title%" rel="nofollow">%title%</a></div>'
);
return $styles;
}
@A5hleyRich
A5hleyRich / add.php
Last active Sep 11, 2015
Delightful Downloads Custom Buttons
View add.php
<?php
function dedo_custom_button( $buttons ) {
$buttons['custom'] = array(
'name' => __( 'Custom Button', 'delightful-downloads' ),
'class' => 'button-custom'
);
return $buttons;
}
@A5hleyRich
A5hleyRich / add.php
Last active Sep 11, 2015
Delightful Downloads Custom Lists
View add.php
<?php
function custom_list( $lists ) {
$lists['icon_date'] = array(
'name' => 'Icon (Date)',
'format' => '<i class="fa fa-download"></i><a href="%url%" title="%title%" rel="nofollow">%title% - %date%</a>'
);
return $lists;
}
@A5hleyRich
A5hleyRich / nginx.conf
Last active Feb 16, 2017
Hosting WordPress Yourself Part 6
View nginx.conf
user ashley;
worker_processes 1;
pid /run/nginx.pid;
events {
worker_connections 1024;
multi_accept on;
use epoll;
}
@A5hleyRich
A5hleyRich / backup.sh
Last active Jul 4, 2016
Simple WordPress Backups
View backup.sh
#!/bin/bash
cd /home/ashley/ashleyrich.com/public
# Backup database
wp db export ../backups/`date +%Y%m%d`_database.sql --add-drop-table
# Backup uploads directory
tar -zcf ../backups/`date +%Y%m%d`_uploads.tar.gz wp-content/uploads
@A5hleyRich
A5hleyRich / nginx.conf
Last active Mar 19, 2016
Hosting WordPress Yourself Multiple Sites
View nginx.conf
user ashley;
worker_processes 1;
pid /run/nginx.pid;
events {
worker_connections 1024;
multi_accept on;
}
http {
You can’t perform that action at this time.