Skip to content

Instantly share code, notes, and snippets.

View keybase.md

Keybase proof

I hereby claim:

  • I am technosailor on github.
  • I am technosailor (https://keybase.io/technosailor) on keybase.
  • I have a public key ASBukfKyoQ_Yb6W8_3tRYnyku9tkjleiNYSZ7xGRbKQCiQo

To claim this, I am signing this object:

View .travis.yml
dist: trusty
language: php
php:
- 7.0
- 7.1
- 7.2
- 7.3
View functions.php
add_filter( 'request' function( $query_vars ) {
if( isset( $query_vars['feed'] ) ) {
$query_vars['post_type'] = [
'post',
'page'
];
}
return $query_vars;
} );
@technosailor
technosailor / check-plugin-vuln.sh
Created Nov 23, 2016
Check all plugins for vulnerabilities via wp-vulnerability-scanner. Requires WP-CLI.
View check-plugin-vuln.sh
for plugin in `wp plugin list --format=csv | cut -d , -f 1`;
do
wp vuln plugin-check $plugin;
done
@technosailor
technosailor / update-mysql56.sh
Created Feb 24, 2016
Updates VVV MySQL 5.5 to 5.6 -- Ubuntu 14.04
View update-mysql56.sh
#!/bin/bash
# Usage: ./update-mysql56.sh
# Backup of all databases... JUST IN CASE
mysqldump --all-databases --single-transaction --events --user=root --password > ~/all_database_backup.sql
# Remove MySQL 5.5
sudo apt-get remove mysql-server
sudo apt-get autoremove
View gist:2ebfa8308ec818b59dbe
[audio mp3="http://technosailor.com/wp-content/uploads/MLKDream_64kb.mp3" start="675"][/audio]
View gist:b41914159f18a6fa635a
class WP_Media_Embed_Start_Time {
public function __construct() {
$this->hooks();
}
public function hooks() {
add_filter( 'shortcode_atts_audio', array( $this, 'add_attributes' ), 10, 3 );
add_filter( 'shortcode_atts_video', array( $this, 'add_attributes' ), 10, 3 );
add_filter( 'wp_audio_shortcode', array( $this, 'add_start_time' ), 10, 5 );
View gist:4291141273e21c885f6b
$user_creds = array(
'user_login' => $member_data['member-username'],
'user_password' => $member_data['member-password'],
//'remember' => false
);
$user = wp_signon( $user_creds, true );
if( is_wp_error( $user ) ) {
$result['redirect'] = site_url( '/login/?error=failed_login' );
@technosailor
technosailor / gist:8358491
Created Jan 10, 2014
Nothing fancy. Just a way to get your external IP. Useful for dealing with services that you have to have a white listed IP and maybe you have a lot of servers in a cluster and need to know what the external service is seeing. It's like I'm describing my own personal hell right now...
View gist:8358491
<?php
$json = file_get_contents( 'http://ifconfig.me/all.json' );
$data = json_decode( $json );
echo $data->ip_addr;
@technosailor
technosailor / gist:7976564
Created Dec 15, 2013
Saves default WordPress edit page filters as usermeta
View gist:7976564
<?php
/*
Plugin Name: AB Edit Filter Save
Version: 0.1
Author: Aaron Brazell
Author URI: http://technosailor.com
Description: Saves default WordPress edit page filters as usermeta
License: GPLv2
*/
class AB_Filter_Save {
You can’t perform that action at this time.