Skip to content

Instantly share code, notes, and snippets.

View butlerblog's full-sized avatar

Chad Butler butlerblog

View GitHub Profile
@jedsundwall
jedsundwall / gist:586144
Created September 18, 2010 23:00
CSS to add commas to items in an unordered list without leaving a comma hanging at the end of the list
ul.tags {
display: inline;
margin: 0;
padding: 0;
}
ul.tags li {
display: inline;
list-style: none;
margin: 0;
@markjaquith
markjaquith / disable-plugins-when-doing-local-dev.php
Created June 24, 2011 10:24
Disables specified WordPress plugins when doing local development
<?php
/*
Plugin Name: Disable plugins when doing local dev
Description: If the WP_LOCAL_DEV constant is true, disables plugins that you specify
Version: 0.1
License: GPL version 2 or any later version
Author: Mark Jaquith
Author URI: http://coveredwebservices.com/
*/
@johnpolacek
johnpolacek / gist:3827270
Last active January 20, 2023 15:46
Prevent FOUC
<!-- Prevent FOUC (flash of unstyled content) - http://johnpolacek.com/2012/10/03/help-prevent-fouc/ -->
<style type="text/css">
.no-fouc {display: none;}
</style>
<script type="text/javascript">
document.documentElement.className = 'no-fouc';
// add to document ready: $('.no-fouc').removeClass('no-fouc');
</script>
@llbbl
llbbl / awesome-php.md
Last active July 23, 2024 19:18 — forked from ziadoz/awesome-php.md
Awesome PHP Libraries and Resources

Awesome PHP

A list of amazingly awesome PHP libraries, resources and shiny things.

Categories

  • Composer
  • Composer Related
  • Frameworks
  • Micro Frameworks
@paulund
paulund / example-wp-list-table.php
Last active May 20, 2024 05:29
An example code of using the WP_List_Table class. With Pagination.
<?php
/*
* Plugin Name: Paulund WP List Table Example
* Description: An example of how to use the WP_List_Table class to display data in your WordPress Admin area
* Plugin URI: http://www.paulund.co.uk
* Author: Paul Underwood
* Author URI: http://www.paulund.co.uk
* Version: 1.0
* License: GPL2
*/
@srikat
srikat / parallax.js
Last active April 9, 2019 16:23
Applying Parallax effect from Parallax Pro in any Genesis theme. http://sridharkatakam.com/apply-parallax-effect-parallax-pro-genesis-theme/
//* Register widget areas
genesis_register_sidebar( array(
'id' => 'parallax-section-below-header',
'name' => __( 'Parallax Section Below Header', 'your-theme-slug' ),
'description' => __( 'This is the parallax section below header.', 'your-theme-slug' ),
) );
genesis_register_sidebar( array(
'id' => 'parallax-section-above-footer',
'name' => __( 'Parallax Section Above Footer', 'your-theme-slug' ),
@ericjuden
ericjuden / wordpress-options-json.php
Last active June 30, 2022 12:33
WordPress Options Class with Support for storing and retrieving JSON
<?php
class My_Plugin_Options {
var $options;
var $option_name;
var $is_site_option; // Are we using Multisite and saving to global options?
function My_Plugin_Options($option_name, $is_site_options = false){
$this->option_name = $option_name;
$this->is_site_option = $is_site_options;
if($this->is_site_option){
@komuw
komuw / how to properly install virtualbox on chromebook
Last active June 3, 2024 18:29
how to properly install virtualbox on chromebook.
Taken from:https://github.com/dnschneid/crouton/wiki/Build-kernel-headers-and-install-Virtualbox-(x86)
https://github.com/dnschneid/crouton/wiki/Build-kernel-headers-and-install-Virtualbox-(x86)
only pasted here so I can be sure I will always have it.
NB: do this ALTERNATIVE INSTEAD(it solves multi reboots on vagrant up)
1. build kernel headers as per this diff method: https://github.com/divx118/crouton-packages/blob/master/README.md
ie: from a shell in ua chroot(ubuntu)
$ cd ~
$ wget https://raw.githubusercontent.com/divx118/crouton-packages/master/setup-headers.sh
@bekarice
bekarice / tab-manager-third-party-tabs.php
Last active November 17, 2018 22:11
Tab Manager Third Party Compat
function third_party_tab( $tabs ) {
global $product;
$some_check = $product ? third_party_check( $product->id ) : null;
if ( $product && ! $some_check ) {
return $tabs;
}
$tabs['third_party_tab'] = array(
@bordoni
bordoni / mailpoet-insert_new_user.php
Last active March 18, 2018 23:27
Insert a new user to MailPoet and handle custom fields
<?php
// The ID of the lists you want to add a user to
$list_ids = array( 1 );
// User Data without the custom fields
$data_subscriber = array(
'user' => array(
'email' => 'johndoe@email.com',
'firstname' => 'John',
'lastname' => 'Doe',