Skip to content

Instantly share code, notes, and snippets.

View jconroy's full-sized avatar

Jason Conroy jconroy

  • Automattic
  • Australia
View GitHub Profile
@stephenharris
stephenharris / debugging-main-query.php
Created March 24, 2013 16:18
Very simple script for debugging queries
<?php
/**
* Will print to the page the main query used for that page. It will do this only for admins.
* This can be put in your theme's functions.php, but should be removed when its no longer needed.
*/
add_action( 'posts_request', 'debug_post_request', 10, 2 );
function debug_post_request( $r, $query ){
if( current_user_can( 'manage_options' ) && $query->is_main_query() ){
@BronsonQuick
BronsonQuick / saas_gravity_forms.scss
Last active December 15, 2015 22:39
A Saas file I use for generating custom Gravity Forms styles for clients sites.
/*!
----------------------------------------------------------------
Gravity Forms Front End Form Styles
Version 1.0
http: //www.gravityforms.com
Based on the original forms.css that ships with Gravity Forms
----------------------------------------------------------------
*/
// Examples can be found here: http://boedesign.com/misc/outer_setters.html
// Discussed here: http://forum.jquery.com/topic/outerheight-int-sets-the-height-taking-into-account-padding-and-border
(function($){
function _outerSetter(direction, args){
var $el = $(this),
$sec_el = $(args[0]),
dir = (direction == 'Height') ? ['Top', 'Bottom'] : ['Left', 'Right'],
@mikejolley
mikejolley / gist:3709371
Created September 12, 2012 19:41
Remove WooCommerce Generator Tag
function my_woocommerce_loaded_function() {
global $woocommerce;
// remove WC generator tag from <head>
remove_action( 'wp_head', array( $woocommerce, 'generator' ) );
}
// called only after woocommerce has finished loading
add_action( 'woocommerce_init', 'my_woocommerce_loaded_function' );
@ryanscherler
ryanscherler / php-openssl.md
Last active August 16, 2018 20:06
Use Homebrew PHP with OpenSSL instead of SecureTransport
@michaellouieloria
michaellouieloria / gist:f2ee272d1709a0e80f71
Last active August 4, 2019 12:10
Phantomjs in Facebook PHP webdriver
Use phantomjs. Start it:
$ phantomjs --webdriver=127.0.0.1:8910
Use:
require_once('lib/__init__.php');
$host = '127.0.0.1:8910';
$capabilities = array(
WebDriverCapabilityType::BROWSER_NAME => 'phantomjs',
@amereservant
amereservant / auth.php
Created October 22, 2011 23:10
phpFlickr API Detailed Example HowTo
<?php
/* Last updated with phpFlickr 3.1
*
* Edit these variables to reflect the values you need. $default_redirect
* and $permissions are only important if you are linking here instead of
* using phpFlickr::auth() from another page or if you set the remember_uri
* argument to false.
*/
// Include configuration file
// Sample event data for a proxy request
// {
// "resource": "Resource path",
// "path": "Path parameter",
// "httpMethod": "Incoming request's method name"
// "headers": {Incoming request headers}
// "queryStringParameters": {query string parameters }
// "pathParameters": {path parameters}
// "stageVariables": {Applicable stage variables}
// "requestContext": {Request context, including authorizer-returned key-value pairs}
map $uri $blogname{
~^(?P<blogpath>/[^/]+/)files/(.*) $blogpath ;
}
map $blogname $blogid{
default -999;
#Ref: http://wordpress.org/extend/plugins/nginx-helper/
#include /var/www/wordpress/wp-content/plugins/nginx-helper/map.conf ;
}
@spigists
spigists / new_gist_file.css
Created October 2, 2013 16:16
Bootstrap 3 styles for Gravity Forms, make sure that in Forms > Settings you have Output CSS set to No and Output HTML5 set to Yes
.gform_wrapper ul {
padding-left: 0;
list-style: none; }
.gform_wrapper li {
margin-bottom: 15px; }
.gform_wrapper form {
margin-bottom: 0; }