This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | <?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); | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | <?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 | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | /** | |
| * 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 ) ); | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | <?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; | |
| } | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | # Enable Powerlevel10k instant prompt. Should stay close to the top of ~/.zshrc. | |
| # Initialization code that may require console input (password prompts, [y/n] | |
| # confirmations, etc.) must go above this block; everything else may go below. | |
| if [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]]; then | |
| source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" | |
| fi | |
| export NVM_DIR="$([ -z "${XDG_CONFIG_HOME-}" ] && printf %s "${HOME}/.nvm" || printf %s "${XDG_CONFIG_HOME}/nvm")" | |
| [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | /////////////////////////////////////////////// | |
| ////// 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, | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | <?php | |
| class StopWatch { | |
| /** | |
| * @var $startTimes array The start times of the StopWatches | |
| */ | |
| private static $startTimes = array(); | |
| /** | |
| * Start the timer | |
| * | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | <?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' ) ) { | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | location ~* ^.+\.(svg|svgz|jpg|jpeg|gif|png|ico|bmp)$ { | |
| try_files $uri @image_fallback; | |
| } | |
| location @image_fallback { | |
| proxy_pass http://{PROD}; | |
| } | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | <IfModule mod_rewrite.c> | |
| RewriteEngine on | |
| # Attempt to load files from production if | |
| # they're not in our local version | |
| RewriteCond %{REQUEST_FILENAME} !-d | |
| RewriteCond %{REQUEST_FILENAME} !-f | |
| RewriteRule wp-content/uploads/(.*) \ | |
| http://{PROD}/wp-content/uploads/$1 [NC,L] | |
| </IfModule> |