Skip to content

Instantly share code, notes, and snippets.

View shawn-crigger's full-sized avatar

Shawn Crigger shawn-crigger

View GitHub Profile
@shawn-crigger
shawn-crigger / get_the_user_ip.php
Created January 6, 2018 21:00
Get the current user IP
<?php
// ------------------------------------------------------------------------
/**
* Returns the users IP address
*
* @return string The user ip.
*/
static public function get_the_user_ip()
@shawn-crigger
shawn-crigger / brew.install.quicklook.sh
Created January 6, 2018 18:42 — forked from N4M3Z/brew.install.quicklook.sh
Install Quick Look Plugins (OS X Caskroom)
#!/bin/sh
##
# Quick Look Plugins
# @url http://caskroom.io
# @brief Quick Look Plugins installed via Homebrew Cask
#
# For a comprehensive overview of Quick Look plugins look here: https://github.com/sindresorhus/quick-look-plugins
#
brew cask install qlcolorcode # Preview source code files with syntax highlighting
brew cask install qlstephen # Preview plain text files without a file extension. Example: README, CHANGELOG, etc.
@shawn-crigger
shawn-crigger / listener.php
Last active January 1, 2018 07:37
Salesforce SOAP API Outbound Message Listener
<?php
/**
* Salesforce Workflow Outboud message reciever sample in PHP
*
* requires: php-soap extension
*
* At 1st you should download WSDL of the message and put it besides this script.
*/
//ini_set("soap.wsdl_cache_enabled", "0"); // clean WSDL for develop
ini_set('display_errors', 1);
@shawn-crigger
shawn-crigger / notify.php
Created December 20, 2017 22:24
Nice little notification box class
<?php
/**
* SC-Tools are a few random classes I wrote over the years to make my life easier. If it makes your life easier consider buying me a beer or a coffee would be better.
*
* @author Shawn Crigger
* @version 0.1.1
* @copyright February 21, 2013
* @package SC-Tools
**/
@shawn-crigger
shawn-crigger / sc_profiler.php
Created December 20, 2017 22:11
Wordpress Debugging and Profiler
<?php
/**
* Extra debugging and profiling information.
*
* Usage information :
*
* Add "&debug=" to the url to enable
*
* &debug=sql - dump all querys run
* &debug=http -
@shawn-crigger
shawn-crigger / takeshots.js
Created December 20, 2017 21:16
Responsive Screenshot Taker
// Takes screenshots of a website in various sizes as defined by array viewportSizes
// Example : casperjs ts.js https://www.explorenorthmyrtlebeach.com
var casper = require("casper").create(),
viewportSizes = [
[320,480],
[320,568],
[600,1024],
[1024,768],
[1280,800],
@shawn-crigger
shawn-crigger / wp_create_admin.php
Last active February 15, 2019 03:39
Quick function to create a admin user in WP
<?php
/**
* Creates an WP admin.
* @see https://tommcfarlin.com/create-a-user-in-wordpress/#code
* @see
* @param string $email_address The email address
* @return boolean
*/
function _create_admin( $email_address = '' )
@shawn-crigger
shawn-crigger / plugin-filter.php
Created July 16, 2017 08:38 — forked from carlodaniele/plugin-filter.php
A Must-use plugin to filter active plugins in on a per-page basis.
<?php
// returns the path of the request URI without the query string
// see http://php.net/manual/en/function.parse-url.php
// and http://php.net/manual/en/reserved.variables.server.php
// and http://php.net/manual/en/url.constants.php
$request_uri = parse_url( $_SERVER['REQUEST_URI'], PHP_URL_PATH );
$is_admin = strpos( $request_uri, '/wp-admin/' );
@shawn-crigger
shawn-crigger / README.md
Created March 17, 2017 17:45 — forked from pauloelias/README.md
Extended ExpressionEngine .htaccess/apache conf

ExpressionEngine .htaccess/Apache conf

Please use these at your own risk. I cannot be responsible for having no idea what I am doing and breaking your server.

This is a collection of Apache configuration settings that I use in my ExpressionEngine projects. Since I have always been a big fan of the HTML5 Boilerplate I took inspiration from their .htaccess file and tweaked my configuration with other settings I have used over the years.

This gist contains:

  • _EXTENDED.htaccess This is a general .htaccess file I rename and edit as needed for each site. Note: When I host a site on my prad/stage/dev servers I move most or all of these rules into the vhost.conf file
  • _SAMPLE.httpd.conf I use Ubuntu on my development, staging, and production servers so this is specific to Apache 2 on my setup. Essentially this file extends the apache2.conf (in my setup).
@shawn-crigger
shawn-crigger / README.md
Created March 17, 2017 17:45 — forked from pauloelias/README.md
Extended ExpressionEngine .htaccess/apache conf

ExpressionEngine .htaccess/Apache conf

Please use these at your own risk. I cannot be responsible for having no idea what I am doing and breaking your server.

This is a collection of Apache configuration settings that I use in my ExpressionEngine projects. Since I have always been a big fan of the HTML5 Boilerplate I took inspiration from their .htaccess file and tweaked my configuration with other settings I have used over the years.

This gist contains:

  • _EXTENDED.htaccess This is a general .htaccess file I rename and edit as needed for each site. Note: When I host a site on my prad/stage/dev servers I move most or all of these rules into the vhost.conf file
  • _SAMPLE.httpd.conf I use Ubuntu on my development, staging, and production servers so this is specific to Apache 2 on my setup. Essentially this file extends the apache2.conf (in my setup).