View block.twitter.live.txt
twitter.com##.is-playing.module.LiveVideoHomePageModule
twitter.com##.roaming-module.LiveVideoHomePageModuleContainer
View php-percentage-calc-format.php
<?php
function employeeGrowth ( int $employees, int $employees_6_months_ago) {
$employee_percent_change = ($employees - $employees_6_months_ago)/$employees_6_months_ago;
$formatter = new NumberFormatter('en_US', NumberFormatter::PERCENT);
echo $formatter->format($employee_percent_change);
View php-money-breakdown-mil-bil.php
<?php
function formatMoney( int $number = null ) {
// display numbers as K or B or M
if ($number < 1000) {
// Anything less than a thousand
$format_num = number_format($number);
} else if ($number < 1000000) {
// Anything less than a million
View estimated-reading-time.php
/**
* Estimate time required to read the article
*
* @return string
*/
function bm_estimated_reading_time() {
$post = get_post();
$words = str_word_count( strip_tags( $post->post_content ) );
View disable-rest-endpoints.php
<?php
/*
* Disable WP REST API JSON endpoints if user not logged in
*/
function chuck_disable_rest_endpoints( $access ) {
if( ! is_user_logged_in() ) {
return new WP_Error( 'rest_cannot_access', __( 'Only authenticated users can access the REST API.', 'disable-json-api' ), array( 'status' => rest_authorization_required_code() ) );
}
return $access;
}
View .zshrc
# Path to your oh-my-zsh installation
export ZSH=/Users/chuck/.oh-my-zsh
# See https://github.com/robbyrussell/oh-my-zsh/wiki/Themes
ZSH_THEME="agnoster"
# Which plugins would you like to load? (plugins can be found in ~/.oh-my-zsh/plugins/*)
# Custom plugins may be added to ~/.oh-my-zsh/custom/plugins/
# Example format: plugins=(rails git textmate ruby lighthouse)
# Add wisely, as too many plugins slow down shell startup.
View Gravity Forms Reset Styles
///////////////////////////////////////////////
////// GRAVITY FORMS RESET STYLES //////
///////////////////////////////////////////////
// These styles are made in mind to be used with SCSS or LESS
// If you use these styles, you must go to the Gravity Forms settings in the WordPress back end and set Output CSS to No.
////----- Core Containers
.gform_heading,
.gform_body,
View stopwatch.php
<?php
class StopWatch {
/**
* @var $startTimes array The start times of the StopWatches
*/
private static $startTimes = array();
/**
* Start the timer
*
View extend-wordpress-user-session.php
<?php
/**
* Extend expiration length of the auth cookie for Administrators when hey check Remember Me
*
* @param int $expiration Cookie expiration passed by auth_cookie_expiration() hook
* @return int 90 days in seconds
*/
function chuck_extend_admins_login_session( $expiration, $user_id, $remember ) {
if ( $remember && user_can( $user_id, 'manage_options' ) ) {
View wp-local-media-nginx.txt
location ~* ^.+\.(svg|svgz|jpg|jpeg|gif|png|ico|bmp)$ {
try_files $uri @image_fallback;
}
location @image_fallback {
proxy_pass http://{PROD};
}