Skip to content

Instantly share code, notes, and snippets.

View pbrocks's full-sized avatar

Paul Barthmaier pbrocks

View GitHub Profile
@pbrocks
pbrocks / 0_reuse_code.js
Last active August 29, 2015 14:12
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@pbrocks
pbrocks / paulund-wp-list-table.php
Last active August 24, 2016 12:43 — forked from paulund/example-wp-list-table.php
An example code of using the WP_List_Table class.With Pagination.
<?php
/*
* Plugin Name: Paulund WP List Table
* Description: An example of how to use the WP_List_Table class to display data in your WordPress Admin area created by Paul Underwood and edited by @palibaacsi according to WP VIP Standards
* Plugin URI: http://www.paulund.co.uk
* Author: Paul Underwood and @palibaacsi
* Author URI: http://www.paulund.co.uk
* Version: 1.2
* License: GPL2
*/
@pbrocks
pbrocks / Sublime-stuffs.txt
Created April 1, 2017 19:53 — forked from vishalbasnet23/Sublime-stuffs.txt
Install PHPCS with WordPress Coding Standard with Sublime Text 3
1. cmd+shift+p
2. Type phpcs and install it
3. Preferences > Package Settings > Php Code Sniffer > User settings
@pbrocks
pbrocks / a.md
Created August 21, 2017 19:46 — forked from ericandrewlewis/a.md
The WordPress Customizer

The WordPress Customizer

The WordPress Customizer is an interface for drafting changes to content while previewing the changes before they are saved. This is an alternative to the "save and suprise" model of changing settings without knowing what exactly will happen.

The customizer can be accessed in the admin interface under Appearance > Customize.

A screenshot of the customizer

#19909 is the trac ticket that introduced the Customizer during the 3.4 release cycle.

@pbrocks
pbrocks / wp-print-hooks.php
Created August 23, 2017 14:04 — forked from arioch1984/wp-print-hooks.php
Wordpress: Print hooks
<?php
/*
Plugin Name: Instrument Hooks for WordPress
Description: Instruments Hooks for a Page. Outputs during the Shutdown Hook.
Version: 0.1
Author: Mike Schinkel
Author URI: http://mikeschinkel.com
*/
if ($_GET['instrument']=='hooks') {
# 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
@pbrocks
pbrocks / html-tooltips.html
Created October 23, 2017 18:36 — forked from tomhodgins/html-tooltips.html
HTML inside Bootstrap tooltips
<!DOCTYPE html>
<html>
<head>
<title>Tooltip HTML Styles</title>
<!-- Bootstrap: with responsive, no icons -->
<link href="http://netdna.bootstrapcdn.com/twitter-bootstrap/2.3.0/css/bootstrap-combined.no-icons.min.css" rel="stylesheet">
<!-- FontAwesome -->
<link href="http://netdna.bootstrapcdn.com/font-awesome/3.0.2/css/font-awesome.css" rel="stylesheet">
@pbrocks
pbrocks / http2https.htaccess
Created December 6, 2017 07:17 — forked from strangerstudios/http2https.htaccess
Forward HTTP requests to HTTPS in Apache htaccess
# Forward HTTP requests to HTTPS
# (!) Make sure to place this under your RewriteEngine On and Rewrite Base lines.
RewriteCond %{HTTPS} !=on
RewriteRule ^(.*) https://%{SERVER_NAME}/$1 [R,L]
@pbrocks
pbrocks / bootstrap-config.json
Last active January 7, 2018 00:36 — forked from anonymous/config.json
Bootstrap Customizer Config
{
"vars": {
"@gray-base": "#000",
"@gray-darker": "lighten(@gray-base, 13.5%)",
"@gray-dark": "lighten(@gray-base, 20%)",
"@gray": "lighten(@gray-base, 33.5%)",
"@gray-light": "lighten(@gray-base, 46.7%)",
"@gray-lighter": "lighten(@gray-base, 93.5%)",
"@brand-primary": "darken(#428bca, 6.5%)",
"@brand-success": "#5cb85c",
@pbrocks
pbrocks / plugin.php
Created January 12, 2018 21:36 — forked from mathetos/plugin.php
Dependent Plugin Activation/Deactivation and Alert
<?php
/*
* Dependent Plugin Activation/Deactivation
*
* Sources:
* 1. https://pippinsplugins.com/checking-dependent-plugin-active/
* 2. http://10up.com/blog/2012/wordpress-plug-in-self-deactivation/
*
*/