Skip to content

Instantly share code, notes, and snippets.

@mphillips
mphillips / get_property.php
Created July 13, 2016 20:54
Helper functions to get a property from an array or object.
<?php
namespace Errthling;
/**
* Get a property from either an object or an array.
*
* @param string $key The name of the property to retrieve
* @param array|object $data The object to retrieve the property for.
* @return mixed
*/
@mphillips
mphillips / nginx-site-config-file.conf
Last active August 16, 2019 14:03
SAML 2.0 Single Sign-On WordPress Plugin Fix for Nginx
# 1) Edit the site's nginx config (/etc/nginx/custom-sites/site-name.conf) to add the lines below.
# 2) Reload nginx: sudo service nginx reload
server {
# existing conf here
# Nginx fix for the SAML 2.0 Single Sign-On plugin.
location ^~ /wp-content/plugins/saml-20-single-sign-on {
location ~ ^(?<script_name>.*?\.php)(?<path_info>/.*)?$ {
include fastcgi_params;