Skip to content

Instantly share code, notes, and snippets.

View fastmover's full-sized avatar

Steven Kohlmeyer fastmover

View GitHub Profile
@fastmover
fastmover / .gitignore
Created November 3, 2016 17:29
Laravel Git Ignore File
/node_modules
/public/storage
/vendor
/.idea
Homestead.json
Homestead.yaml
.env*
*bower_components*
*.js.map
*.css.map
nano
bind-utils (dig)
@fastmover
fastmover / deploy.sh
Created October 4, 2016 18:24 — forked from kjohnson/deploy.sh
Ninja Forms deploy script
#!/bin/sh
# By Mike Jolley, based on work by Barry Kooij ;)
# License: GPL v3
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
function powerPressHTTPStoHTTP( $ID = false, $post = false, $update = false )
{
if( ! $ID )
return;
if( isset( $_REQUEST[ 'Powerpress' ] ) and is_array( $_REQUEST[ 'Powerpress' ] ) ) {
$powerPress = $_REQUEST[ 'Powerpress' ];
@fastmover
fastmover / POOL.conf
Created June 21, 2016 04:57
/etc/php/fpm/pool.d/POOL.conf
;; Performance:
listen.backlog = -1
pm = static
;; Max Children is the number of PHP processes running to handle user requests. Set to 2x Number of CPU Cores.
pm.max_children = 8
pm.max_requests = 0
pm.start_servers = 1
pm.min_spare_servers = 1
pm.max_spare_servers = 2
@fastmover
fastmover / wp-restrict-user-media.php
Created February 10, 2016 22:23
WordPress: Allow the user to only see media they've uploaded.
add_action('pre_get_posts','users_own_attachments');
function users_own_attachments( $wp_query_obj ) {
global $current_user, $pagenow;
if( !is_a( $current_user, 'WP_User') )
return;
if( !in_array( $pagenow, array( 'upload.php', 'admin-ajax.php' ) ) )
@fastmover
fastmover / reset-mysql-root-pass.sh
Created December 3, 2015 19:18
Reset mysql root password on ubuntu setup with easy engine.
service mysql stop
mysqld_safe --skip-grant-tables > /dev/null 2>&1 &
mysql -u root -e "use mysql; update user set password=PASSWORD('NEW-PASSWORD') where User='root'; flush privileges;"
service mysql restart
@fastmover
fastmover / mailchimp-responsive-email-template.html
Created October 13, 2015 18:08
Mailchimp Responsive E-Mail Template, reference https://www.campaignmonitor.com/css/ for compatibility, also if using with WordPress use plugin SB-RSS_feed-plus to add featured images to feed
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta property="og:title" content="*|MC:SUBJECT|*">
<title>*|MC:SUBJECT|*</title>
<style type="text/css">
#outlook a{
<?php
/**
* Created by Steven Kohlmeyer
* Date: 10/2/15
* Time: 11:35 AM
*/
/*
* This file will randomly pick an image in the folder specified below by $imagesDir, rename it to the new image file name specified by $newImageName.
@fastmover
fastmover / wp-custom-taxonomy-permalink-rewrite.php
Created October 1, 2015 19:37
This script will allow you to create output on all level's of slugs for a custom post type with a custom taxonomy.