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.
# Install a new WP site. | |
# Usage: wpinstall <sitename> | |
function wpinstall() { | |
# Make the directory in your local web root | |
mkdir ~/Sites/www/$@; | |
cd ~/Sites/www/$@; | |
# Download, config, and install WordPress using <sitename> for the database, URL, and site title | |
# Note: You'll need to configure your wp-cli defaults for core config and core install in a wp-cli.yml file | |
wp core download; |
// Data courtesy http://country.io/data/ | |
$countries = [ | |
'AD' => [ 'name' => 'Andorra', 'alpha2' => 'AD', 'alpha3' => 'AND', 'currency' => 'EUR', ], | |
'AE' => [ 'name' => 'United Arab Emirates', 'alpha2' => 'AE', 'alpha3' => 'ARE', 'currency' => 'AED', ], | |
'AF' => [ 'name' => 'Afghanistan', 'alpha2' => 'AF', 'alpha3' => 'AFG', 'currency' => 'AFN', ], | |
'AG' => [ 'name' => 'Antigua and Barbuda', 'alpha2' => 'AG', 'alpha3' => 'ATG', 'currency' => 'XCD', ], | |
'AI' => [ 'name' => 'Anguilla', 'alpha2' => 'AI', 'alpha3' => 'AIA', 'currency' => 'XCD', ], | |
'AL' => [ 'name' => 'Albania', 'alpha2' => 'AL', 'alpha3' => 'ALB', 'currency' => 'ALL', ], | |
'AM' => [ 'name' => 'Armenia', 'alpha2' => 'AM', 'alpha3' => 'ARM', 'currency' => 'AMD', ], | |
'AO' => [ 'name' => 'Angola', 'alpha2' => 'AO', 'alpha3' => 'AGO', 'currency' => 'AOA', ], |
h3:before { | |
display: inline-block; | |
margin-left: -45px; | |
padding-right: 45px; | |
width: 30px; | |
height: 30px; | |
background: url('https://cldup.com/_NaTHCOsGQ.svg') no-repeat; | |
content: ''; | |
} |
<?php | |
/** | |
* Plugin Name: Comments Page | |
* Plugin URI: https://WPSessions.com | |
* Description: Makes comments for a post accessible at <post_url>/comments/. | |
* Author: Brian Richards | |
* Author URI: https://rzen.net | |
* Text Domain: comments-page | |
* Domain Path: /languages | |
* Version: 0.1.0 |
Using only this, hiting ^/bpa/whatever/ serves blog archive instead of static front page. | |
<?php | |
/** | |
* Create url endpoint for BPA | |
* | |
* @since 1.0.0 | |
*/ | |
function cfpurl_rewrite_rules() { |
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.
<IfModule mod_rewrite.c> | |
RewriteEngine On | |
RewriteCond %{REQUEST_FILENAME} !-f [NC] | |
RewriteRule ^(.*\.(js|css|png|jpe?g|gif|ico)) http://example.com/$1 [NC,P,L] | |
</IfModule> |
<?php | |
$url = esc_url( get_post_meta( $post->ID, '_project-url', true ) ); | |
if ( ! empty( $url ) { | |
printf( '<p>%s</p>', $url ); | |
} | |
?> |
<?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 ) { |
#!/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; |