Skip to content

Instantly share code, notes, and snippets.

View brichards's full-sized avatar

Brian Richards brichards

View GitHub Profile
#!/usr/bin/php
<?php
echo PHP_EOL;
echo 'Starting unit tests' . PHP_EOL;
exec( 'phpunit', $test_output, $returnCode );
if ( 0 !== $returnCode ) {
echo implode( PHP_EOL, $test_output );
echo PHP_EOL;
<?php
/**
* Output HTML markup for forum post list.
*
* @since 1.0.0
*
* @param integer $post_count Post count.
*/
function skbp_output_forum_posts_list( $post_count = 5 ) {
<?php
$url = esc_url( get_post_meta( $post->ID, '_project-url', true ) );
if ( ! empty( $url ) {
printf( '<p>%s</p>', $url );
}
?>

Chatpen

Multiuser chat built with React and Firebase. Note that this is on the Firebase free plan, so if more than 50 users are on it things may go south.

A Pen by Brad Daily on CodePen.

License.

@brichards
brichards / functions.php
Created January 8, 2013 15:07
Layout Override
<?php
// Force a one column layout if the user is not logged in
add_filter( 'get_theme_layout', 'my_layout_override' );
function my_layout_override( $layout ) {
if ( ! is_user_logged_in() )
$layout = 'layout-one-col';
return $layout;
@brichards
brichards / functions.php
Created January 8, 2013 22:21
Remove SB Options Menu
add_action( 'admin_init', 'remove_sb_options_menu', 20 );
function remove_sb_options_menu() {
remove_submenu_page( 'themes.php', 'sb_admin' );
}
@brichards
brichards / SublimeLinter.sublime-settings
Last active December 11, 2015 07:18
Sublime Linter Settings
{
"sublimelinter_delay": 0.5,
"sublimelinter_mark_style": "fill",
"jshint_options" :
{
"evil": true,
"regexdash": true,
"browser": true,
"wsh": true,
"trailing": true,
@brichards
brichards / functions.php
Created January 31, 2013 17:28
Filter child option defaults
add_filter( 'sb_child_option_defaults', 'my_option_defaults' );
@brichards
brichards / functions.php
Created January 31, 2013 17:28
Filter options on reset
add_filter( 'sb_option_defaults', 'my_option_defaults' );
@brichards
brichards / functions.php
Created January 31, 2013 17:29
Override StartBox Option Defaults
<?php
// Set some new option defaults for our theme
function my_option_defaults( $defaults ) {
// Set some new options
$defaults['option_name'] = 'value';
$defaults['option_name'] = 'value';
$defaults['option_name'] = 'value';