Skip to content

Instantly share code, notes, and snippets.

Avatar

Paul Clark pdclark

View GitHub Profile
@pdclark
pdclark / wordpress-dot-org-responsive-fixes.css
Last active Aug 29, 2015
Basic fix for WordPress.org sidebar hiding content at bottom on small and medium window sizes.
View wordpress-dot-org-responsive-fixes.css
/**
* Use with a user stylesheet plugin.
* For example: https://chrome.google.com/webstore/detail/minimalist-for-everything/bmihblnpomgpjkfddepdpdafhhepdbek?hl=en-US
*
* ## Minimalist Setup:
* Dashboard > Add Module > Edit
* Set @includes to: *wordpress.org*
* Add Option: Paste this file into "CSS"
* Save Changes
*/
@pdclark
pdclark / 0_reuse_code.js
Last active Aug 29, 2015
Here are some things you can do with Gists in GistBox.
View 0_reuse_code.js
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@pdclark
pdclark / delete-highrise-deals.js
Created Apr 11, 2014
Delete all deals in Highrise by 37Signals (basecamp.com)
View delete-highrise-deals.js
/**
* This script should be pasted into a Browser debug console
* after clicking the Highrise links to show all deals.
*
* It may need to be run several times to deal with the massive amount
* of AJAX queries.
*/
// Inject jQuery
var s=document.createElement('script');
View keybase.md

Keybase proof

I hereby claim:

  • I am pdclark on github.
  • I am pdclark (https://keybase.io/pdclark) on keybase.
  • I have a public key ASDUDwwuNpqmQCD-5gMd29Wf_iAEsohgabdyE4SFBjzXhwo

To claim this, I am signing this object:

@pdclark
pdclark / ajax-enqueue-script-with-rest-api.php
Last active Jun 19, 2021
Set a random background color from values calculated in PHP. Load random words from a remote API. Update every 3 seconds.
View ajax-enqueue-script-with-rest-api.php
<?php
/**
* Plugin Name: AJAX Enqueue Script with REST API Example.
* Description: Set a random background color from values calculated in PHP. Load random words from a remote API. Update every 3 seconds.
*/
/**
* Data sent in JSON via wp_localize_script() for initialData and wp_ajax action for update_data.
*/
add_filter(
@pdclark
pdclark / block-hi-test.php
Last active Jul 29, 2021
The shortest possible example PHP-rendered WordPress block.
View block-hi-test.php
<?php
/**
* Plugin Name: Block — Hi Test
* Description: The shortest possible example PHP-rendered WordPress block.
* Author: Paul Clark
* Author URI: https://pdclark.com
*
* @package hi
*/
@pdclark
pdclark / block-pods.php
Last active Aug 3, 2021
Gutenberg block to wrap the `[pods]` shortcode.
View block-pods.php
<?php
/**
* Plugin Name: PodsBlock
* Description: Gutenberg block to wrap the `[pods]` shortcode.
* Author: Paul Clark
* Author URI: https://pdclark.com
* Plugin URI: https://pd.cm/pods-block
* Version: 28
*
* @package pd
@pdclark
pdclark / pd-blocks-example-oop.php
Last active Aug 4, 2021
Short example OOP PHP-rendered WordPress blocks with attributes.
View pd-blocks-example-oop.php
<?php
/**
* Plugin Name: PD BlocksExample OOP with attributes
* Description: Single-file OOP PHP-rendered WordPress blocks with 5 example blocks.
* Author: Paul Clark
* Author URI: https://pdclark.com
* Plugin URI: https://pd.cm/oop-blocks
* Version: 27
*
* @package pd
@pdclark
pdclark / ajax-enqueue-script-example.php
Last active Aug 18, 2021
WordPress plugin demonstrating WP AJAX API. Set a random background color from values calculated in PHP. Load random words from a remote API. Update every 3 seconds.
View ajax-enqueue-script-example.php
<?php
/**
* Plugin Name: AJAX Enqueue Script Example
* Description: Set a random background color from values calculated in PHP. Load random words from a remote API. Update every 3 seconds.
*/
/**
* Data sent in JSON via wp_localize_script() for initialData and wp_ajax action for update_data.
*/
add_filter(