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 | |
//$series = []; | |
//$series = ['Jimmy']; | |
//$series = ['Lisa']; | |
//$series = ['Jimmy', 'Lisa']; | |
//$series = ['Jimmy', 'Lisa', 'Jimmy']; | |
//$series = ['Jimmy', 'Lisa', 'Jimmy', 'Lisa']; | |
//$series = ['Jimmy', 'Lisa', 'Jimmy', 'Jimmy']; | |
//$series = ['Jimmy', 'Jimmy', 'Jimmy']; |
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
# ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## # | |
# Yet-Another-Bench-Script # | |
# v2022-02-18 # | |
# https://github.com/masonr/yet-another-bench-script # | |
# ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## # | |
Sun Feb 20 05:07:23 UTC 2022 | |
Basic System Information: |
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 feetInchesToCm(int $feet, int $inches): int | |
{ | |
return number_format((($feet * 12) + $inches) * 2.54, 0); | |
} |
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 poundsToKg(int $pounds): int | |
{ | |
return number_format(($pounds * 0.45359237), 0); | |
} |
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 | |
$sample1 = "PT12M00.00S"; | |
$sample2 = "PT01M05S"; | |
$sample3 = "PT00M05.30S"; | |
$sample4 = "PT00M00.00S"; | |
function PTFormatAsArray(string $timestamp): array | |
{ | |
if (str_contains($timestamp, ".")) { | |
$after_dot = substr($timestamp, strpos($timestamp, ".") + 1); |
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 timeElapsedString(string $past_datetime, bool $full_string = true): string | |
{ | |
$now = new DateTime; | |
$difference = $now->diff(new DateTime($past_datetime)); | |
$difference->w = floor($difference->d / 7); | |
$difference->d -= ($difference->w * 7); | |
$formats = array( | |
'y' => 'year', | |
'm' => 'month', |
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 | |
$file = "jellyfish.mkv"; | |
$thumb_start = "thumbnail1.jpg"; | |
$thumb_finish = "thumbnail2.jpg"; | |
if (isset($_POST['time_string'])) { | |
if ($_POST['type'] === 'start') { | |
exec("ffmpeg -y -ss {$_POST['time_string']} -i $file -vframes 1 -q:v 1 $thumb_start"); | |
} else { | |
exec("ffmpeg -y -ss {$_POST['time_string']} -i $file -vframes 1 -q:v 1 $thumb_finish"); |
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 | |
$file = "jellyfish.mkv"; | |
$thumb = "thumbnail.jpg"; | |
if (isset($_POST['time_string'])) { | |
exec("ffmpeg -y -ss {$_POST['time_string']} -i $file -vframes 1 -q:v 1 $thumb"); | |
} elseif (!file_exists("thumbnail.jpg")) { | |
exec("ffmpeg -y -ss 00:00:01 -i $file -vframes 1 -q:v 1 $thumb"); | |
} | |
?> |
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 AddCopyToFileName(string $file_name): string | |
{ | |
$ext = pathinfo($file_name, PATHINFO_EXTENSION);//json | |
if (!str_contains($file_name, '_')) {//OG file name, no _2 etc | |
$file_name_no_ext = str_replace(".$ext", "", $file_name);//ralphy | |
$number = 0; | |
} else { | |
$number = str_replace(".$ext", "", substr(strrchr($file_name, '_'), 1)); |
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 commentData(array $data): array | |
{ | |
if (isset($data['data']['body'])) { | |
$d = $data['data']; | |
if (isset($d['author_flair_richtext'][0])) { | |
$frt = $d['author_flair_richtext']; | |
if ($frt[0]['e'] === 'text') { | |
$flair = $frt[0]['t']; |
NewerOlder