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 | |
| $dir = getcwd(); | |
| $algos = ['md5', 'sha1', 'sha256', 'sha512']; | |
| $files = explode(',', $argv[1]); | |
| $lines = ''; | |
| foreach ($files as $file) { |
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 | |
| interface ANSI { | |
| const BLACK = "\033[30m"; | |
| const RED = "\033[31m"; | |
| const GREEN = "\033[32m"; | |
| const YELLOW = "\033[33m"; | |
| const BLUE = "\033[34m"; | |
| const MAGENTA = "\033[35m"; | |
| const CYAN = "\033[36m"; |
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
| <link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/highlightjs/cdn-release@11.7.0/build/styles/dark.min.css"> | |
| <script src="https://cdn.jsdelivr.net/gh/highlightjs/cdn-release@11.7.0/build/highlight.min.js"></script> | |
| <script>hljs.highlightAll();</script> | |
| <style>.prose :where(pre):not(:where([class~=not-prose] *)) { background-color: #303030 } </style> | |
| <style>pre code.hljs { padding: 0; }</style> |
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 | |
| // Put your input in here | |
| $input = <<<'MARKDOWN' | |
| [](https://github.com/hydephp/develop/actions/workflows/continuous-integration.yml) | |
| [](https://packagist.org/packages/hyde/framework) | |
| [](https://github.com/hydephp/develop/blob/master/LICENSE.md) | |
| MARKDOWN; | |
| // Compile to HTML according to pattern: |
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
| { | |
| "preset": "laravel", | |
| "rules": { | |
| "class_attributes_separation" : false | |
| } | |
| } |
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
| # Useful Bash Commands | |
| # SED Templates | |
| sed -i 's/old/new/g' input.txt # Edit within file | |
| sed 's/old/new/g' input.txt > output.txt # Edit to new file | |
| # Add SHA256 checksums for all files to checksums.txt (not recursive) | |
| for i in *; do sha256sum $i >> checksums.txt; done |
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
| Str::macro('bytesToHuman', /** Format the given number of bytes into a human-readable format. */ | |
| function (int $bytes, $precision = 2): string { | |
| for ($i = 0; $bytes > 1024; $i++) { | |
| $bytes /= 1024; | |
| } | |
| return round($bytes, $precision) . ' ' . ['B', 'KB', 'MB', 'GB', 'TB'][$i]; | |
| } | |
| ); | |
| } |
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
| <label for="gridSizeInput">Grid size</label> | |
| <input id="gridSizeInput" type="range" min="1" max="9" value="3" title="3 columns" oninput="setGridSize(this)"> | |
| <section class="grid grid-cols-3 gap-4" id="myGrid"> | |
| // Items... | |
| </section> | |
| <script> | |
| function setGridSize(input) { | |
| input.title = `${input.value} columns`; |
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
| Str::macro('bytesToHuman', /** Format the given number of bytes into a human-readable format. */ | |
| function (int $bytes, int $precision = 2): string { | |
| for ($i = 0; $bytes > 1024; $i++) { | |
| $bytes /= 1024; | |
| } | |
| return round($bytes, $precision) . ' ' . ['B', 'KB', 'MB', 'GB', 'TB'][$i]; | |
| } | |
| ); | |
| } |
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
| $person = { | |
| string $name = 'Jack'; | |
| int $age = 21; | |
| } | |
| echo "$person->name is $person->age years old"; |