Skip to content

Instantly share code, notes, and snippets.

View fastmover's full-sized avatar

Steven Kohlmeyer fastmover

View GitHub Profile
/*! Copyright (c) 2010 Brandon Aaron (http://brandonaaron.net)
* Licensed under the MIT License (LICENSE.txt).
*
* Version 1.2.3
*/
(function (factory) {
if (typeof define === 'function' && define.amd) {
// AMD. Register as an anonymous module.
define(['jquery'], factory);
@fastmover
fastmover / FillGravityForm.js
Created June 24, 2014 16:10
Auto fill GravityForms for testing
jQuery('.gfield').each(function() {
if( jQuery(this).find('.ginput_container').length && jQuery(this).find('.ginput_container').find('input').length && ( jQuery(this).find('.ginput_complex').length == 0 ) ) {
var Label = jQuery(this).find('label').text();
var filler = "";
switch(true) {
case String(Label).search(/first/i) != -1:
#!/bin/sh
if ps ax | grep -v grep | grep -v $0 | grep mysqld > /dev/null
then
echo "mysqld service running, everything is fine"
else
echo "mysqld is not running"
service mysql start
fi
@fastmover
fastmover / install.sh
Created February 17, 2015 20:46
puphpet box install phpmyadmin
sudo apt-get install phpmyadmin
sudo ln -s /usr/share/phpmyadmin /var/www/default/phpmyadmin
@fastmover
fastmover / downloadwordpress.sh
Last active June 22, 2016 23:14
Install the latest stable release of Wordpress into the current directory - removes default plugins and themes (except for twentyfifteen)
wget http://wordpress.org/latest.tar.gz
tar -xzvf latest.tar.gz
mv ./wordpress/* .
rm -rf wordpress
rm wp-content/plugins/hello.php
rm -rf wp-content/themes/twentythirteen
rm -rf wp-content/themes/twentyfourteen
rm latest.tar.gz
@fastmover
fastmover / mysql-tunnel.sh
Created April 24, 2015 18:43
Mysql Localhost Tunnel to Vagrant box - be sure to change the path to the private key
ssh -C -N vagrant@localhost -p 2222 -L 3307:127.0.0.1:3306 -i ~/htdocs/.vagrant/machines/default/virtualbox/private_key
@fastmover
fastmover / functions.php
Created May 14, 2015 02:18
Live Reload Theme functions for Wordpress and Grunt-contrib-watch
<?php
function removePortFromURL ( $url = false )
{
if ( ! $url ) {
return false;
}
$url = rtrim ( $url, '/' );
@fastmover
fastmover / getShares.php
Last active September 30, 2015 19:50
A method for use in Wordpress for getting social share counts and cache them for an hour or specified time.
public function getShares ( $network, $url = false, $cacheTime = 3600 ) {
if( $url === false )
$url = ( is_ssl() ? 'https://' : 'http://' ) . $_SERVER["HTTP_HOST"] . $_SERVER["REQUEST_URI"];
$transientKey = $network . "_" . sanitize_title( $url );
$transient = get_transient( $transientKey );
if( false !== $transient )
<?php
/**************************************************************************
Plugin Name: Disable Search Query
Description: Disables Search Queries in URL
Version: 0.0.1
Author: Fastmover
**************************************************************************/
#Generate Key and CSR
sudo openssl genrsa -out websitename.com.key 4096
sudo openssl req -new -key websitename.com.key -out websitename.com.csr -sha512