This file contains 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
#!/bin/bash | |
folder="/var/www/{website}/wp-content/uploads/video" | |
for filename in $folder/*.mov; do | |
if [ -f $filename ]; then | |
ffprobe -hide_banner -v quiet -print_format json -show_format -show_streams $filename > $folder/$(basename -s .mov $filename).json | |
fi | |
done | |
for filename in $folder/*.mp4; do | |
if [ -f $filename ]; then | |
ffprobe -hide_banner -v quiet -print_format json -show_format -show_streams $filename > $folder/$(basename -s .mp4 $filename).json |
This file contains 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 | |
add_filter( 'body_class', function( $classes ) { | |
$restrict_page = ( get_field( 'msp_registration_required' ) ? true : false ); | |
error_log( "before count = " . count( $classes ) ); | |
if ( $restrict_page ) { | |
$classes[] = 'msp-restrict-page'; | |
} | |
error_log( "after count = " . count( $classes ) ); | |
return $classes; | |
} ); |
This file contains 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
alias rm='rm -i' | |
alias cp='cp -i' | |
alias mv='mv -i' | |
alias aliases='nano ~/.bashrc' | |
alias realias='. ~/.bashrc' | |
alias ls="ls -ahl --color=never --group-directories-first" | |
alias del=rm | |
alias cls=clear |
This file contains 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 tscpl_pb_edit_titles( $title ) { | |
$screen = get_current_screen(); | |
switch ( $screen->post_type ) { | |
case 'event': | |
case 'eventsregistration': | |
case 'eventsapi': |
This file contains 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
// returns an array with the dates for a recurring monthly rule | |
$dates = tscpl_recurring_monthly( $start_date, $end_date, 'fourth', 'tuesday ); | |
function tscpl_recurring_weekly( $start_date, $end_date = null, $dow ) { | |
$days = array( | |
'sunday' => 0, | |
'monday' => 1, | |
'tuesday' => 2, |
This file contains 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
function array_sort_by_key( $array, $key ) { | |
$compare = make_key_cmp( $key ); | |
usort( $array, $compare ); | |
return $array; | |
} | |
function make_key_cmp( $key ) { | |
$code = "if (\$a['$key'] == \$b['$key']) return 0;"; | |
$code .= "return (\$a['$key'] < \$b['$key']) ? -1 : 1;"; | |
return create_function( '$a,$b', $code ); |
This file contains 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 | |
/***************************************************************************************************************************************************** | |
* | |
* Usage: [acf_href href_before="mailto:" href="acf:field_name" text="acf:field_name"] | |
* | |
* acf:fieldname will retrieve the value of the specified "fieldname" and use that. | |
* get:url_variable will grab a variable from the URL and use that. | |
* | |
* [acf_href href="acf:my_link" text="Link to web site"] |
This file contains 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
$args = array( | |
'post_type' => 'eventsapi', | |
'numberposts' => -1, | |
'meta_query' => array( | |
'event_date' => array( 'key' => 'event_date', 'value' => $date, 'compare' => '=' ), | |
'event_time' => array( | |
'relation' => 'OR', | |
array( 'key' => 'event_start', 'compare' => 'EXISTS' ), | |
array( 'key' => 'event_start', 'compare' => 'NOT EXISTS' ), | |
), |
This file contains 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
function tscpl_recurring_weekly( $start_date, $dow, $count ) { | |
$days = array( | |
'sunday' => 0, | |
'monday' => 1, | |
'tuesday' => 2, | |
'wednesday' => 3, | |
'thursday' => 4, | |
'friday' => 5, | |
'saturday' => 6 |
NewerOlder