Skip to content

Instantly share code, notes, and snippets.

View jeremyescott's full-sized avatar

Jeremy Scott jeremyescott

View GitHub Profile
@nunomorgadinho
nunomorgadinho / gist:b2d8e5b8f5fec5b0ed946b24fa288a91
Created February 10, 2017 13:30
PHPCS + WordPress Coding Standards
# Install brew
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
# Install composer
brew install homebrew/php/composer
### PHPCS
composer global require "squizlabs/php_codesniffer=*"
# Add to your .bash_profile
@chuckreynolds
chuckreynolds / local-dev-remote-images.php
Created April 3, 2015 06:22
WordPress local dev environment plugin and config to use images from a live server instead of looking on local url path
<?php
/*
* Plugin Name: Local Dev Remote Images
* Description: this will allow a local dev environment to call all images in uploads from a remote server
* Version: 0.1
* License: GPL
* Author: @chuckreynolds
* Author URI: https://chuckreynolds.us
*/
@michaelcurry
michaelcurry / hello_dolly_oop.php
Last active January 3, 2017 03:28
This is an object-oriented sample Wordpress plugin. Blog Post: http://www.kernelcurry.com/blog/object-oriented-wordpress-plugin
<?php
/**
* @package Hello_Dolly_OOP
* @version 0.1
*/
/*
Plugin Name: Hello Dolly OOP
Plugin URI: http://kernelcurry.com/blog/object-oriented-wordpress-plugin
Description: This plugin is an object oriented version of Matt Mullenweg's Hello Dolly plugin.
Version: 0.1
@webaware
webaware / force-ssl-url-scheme.php
Last active September 5, 2024 01:35
For WordPress, force the protocol scheme to be HTTPS when is_ssl() doesn't work, e.g. on a load-balanced server where _SERVER['HTTPS'] and _SERVER['SERVER_PORT'] don't indicate that SSL is being used. NB: may not be needed now, see SSL Insecure Content Fixer and HTTP Detection: https://ssl.webaware.net.au/https-detection/
<?php
/*
Plugin Name: Force SSL URL Scheme
Plugin URI: https://gist.github.com/webaware/4688802
Description: Force the protocol scheme to be HTTPS when is_ssl() doesn't work
Version: 1.0.0
Author: WebAware
Author URI: http://webaware.com.au/
@ref: http://wordpress.org/support/topic/ssl-insecure-needs-35-compatibility
@jonathanmoore
jonathanmoore / gist:2640302
Created May 8, 2012 23:17
Get the share counts from various APIs

Share Counts

I have always struggled with getting all the various share buttons from Facebook, Twitter, Google Plus, Pinterest, etc to align correctly and to not look like a tacky explosion of buttons. Seeing a number of sites rolling their own share buttons with counts, for example The Next Web I decided to look into the various APIs on how to simply return the share count.

If you want to roll up all of these into a single jQuery plugin check out Sharrre

Many of these API calls and methods are undocumented, so anticipate that they will change in the future. Also, if you are planning on rolling these out across a site I would recommend creating a simple endpoint that periodically caches results from all of the APIs so that you are not overloading the services will requests.

Twitter

@chuckreynolds
chuckreynolds / robots.txt
Last active July 17, 2024 16:57
Solid start Robots.txt for WordPress Sites. (HEADS UP: Make sure you're viewing the most recent version of this Gist) https://gist.github.com/chuckreynolds/135728/
# robots.txt for wordpress
# https://gist.github.com/chuckreynolds/135728
User-agent: *
Disallow: /*.php$
Disallow: /cgi-bin/
Disallow: /comment-page-*
Disallow: /?s=*
Disallow: /search/*
Disallow: /trackback/