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
| #!/bin/bash | |
| # Define the two directories | |
| dir1="" | |
| dir2="" | |
| # Find and compare .php and .html files | |
| find "$dir1" -name '*.php' -o -name '*.html' | while read -r file; do | |
| # Get the relative path of the file | |
| relative_path="${file#$dir1/}" |
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
| # | |
| # look for files of size 512Kb or more (for movies can be set to something large) | |
| # if file size differs, files are different | |
| # if file size is same, compare their MD5 hashes | |
| # if hashes match, output these files as duplicates | |
| # | |
| # Author: https://www.reddit.com/r/synology/comments/10yxgjq/comment/j80p942 | |
| # | |
| find . -not -empty -links 1 -type f -size +512k -printf "%s\n" | sort -rn | uniq -d | xargs -I{} -n1 find . -type f -size {}c -print0 | xargs -0 md5sum | sort | uniq -w32 --all-repeated=separate |
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
| if (! function_exists('convert_base64_to_image')) { | |
| /** | |
| * Searches for base64 string in the text. Thanks Pentium10 for the regex pattern. | |
| * Transforms to the image binary and saves to the specified path. | |
| * | |
| * @param string $source <p> Text containing base64 string </p> | |
| * @param \App\Question $question <p>Question model</p> | |
| * @return array|string|string[]|null This function returns a new text with replaced path to the image. | |
| * @author Pentium10 | |
| * @link https://stackoverflow.com/a/11382564 |
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
| <script> | |
| $(document).ready(function(){ | |
| updateImage(); | |
| }); | |
| let schedule = { | |
| morning: {start: '05:00', end: '11:59'}, | |
| noon: {start: '12:00', end: '16:59'}, | |
| evening: {start: '17:00', end: '20:59'}, | |
| night: {start: '21:00', end: '04:59'}, |
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 | |
| declare(strict_types=1); | |
| /** | |
| * Created by PhpStorm. | |
| * User: dima23 | |
| * Date: 17.07.22 | |
| * Time: 13:55 | |
| */ |
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
| #!/bin/bash | |
| #set -x | |
| # Shows you the largest objects in your repo's pack file. | |
| # Written for osx. | |
| # | |
| # @see http://stubbisms.wordpress.com/2009/07/10/git-script-to-show-largest-pack-objects-and-trim-your-waist-line/ | |
| # @author Antony Stubbs | |
| # set the internal field spereator to line break, so that we can iterate easily over the verify-pack output |