✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨
SUPPORT MY WORK - Everything Helps Thanks
YouTube 🔗 https://YouTube.GetMeTheGeek.com
Buy Me a Coffee ☕ https://www.buymeacoffee.com/getmethegeek
Hire US 🔗 https://getmethegeek.com
Digital Ocean referral 🔗 https://tiny.cc/plxdigitalocean
✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨
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 input file name | |
| INPUT_FILE="ids.txt" | |
| # Check if the file exists | |
| if [[ ! -f "$INPUT_FILE" ]]; then | |
| echo "Error: File '$INPUT_FILE' not found." | |
| exit 1 | |
| fi |
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
| -- Levenshtein function | |
| -- Source: https://openquery.com.au/blog/levenshtein-mysql-stored-function | |
| -- Levenshtein reference: http://en.wikipedia.org/wiki/Levenshtein_distance | |
| -- Arjen note: because the levenshtein value is encoded in a byte array, distance cannot exceed 255; | |
| -- thus the maximum string length this implementation can handle is also limited to 255 characters. | |
| DELIMITER $$ | |
| DROP FUNCTION IF EXISTS LEVENSHTEIN $$ | |
| CREATE FUNCTION LEVENSHTEIN(s1 VARCHAR(255) CHARACTER SET utf8, s2 VARCHAR(255) CHARACTER SET utf8) |
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 | |
| $currentPage = $_SERVER["PHP_SELF"]; | |
| $maxRows = 15; | |
| $pageNum = 1; | |
| if (isset($_GET['page'])) { | |
| $pageNum = $_GET['page']; | |
| } | |
| $startRow = ($pageNum - 1) * $maxRows; |
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
| // directives/TimeAgo.js | |
| import DateTime from 'luxon/src/datetime.js'; | |
| /** | |
| * Need Luxon https://moment.github.io/luxon/ | |
| * @usage import Timeago from '../directives/TimeAgo'; | |
| Vue.use(Timeago, {locale: 'pt-BR'}); // or Vue.use(Timeago); | |
| * @param opts | |
| */ |
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
| dependencies: | |
| path_provider: ^1.6.10 |
Usando o cli da AWS:
aws s3 ls s3://bucket/pasta/ | awk {'print "aws s3 rm s3://bucket/pasta/" $2 " --recursive --exclude \"*\" --include \"chamada*.mp3\" --include \"nome*.mp3\""'} | bash
- aws s3 ls s3://bucket/pasta/ lista as subpastas
- awk {'print "aws s3 rm s3://bucket/pasta/" $2 " --recursive --exclude "" --include "chamada.mp3" --include "nome*.mp3""'} monta o comando
When setting these options consider the following:
- How long is your average request?
- What is the maximum number of simultaneous visitors the site(s) get?
- How much memory on average does each child process consume?
sudo grep max_children /var/log/php?.?-fpm.log.1 /var/log/php?.?-fpm.log
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 | |
| /** | |
| * Retrieves the thumbnail from a youtube or vimeo video | |
| * @param - $src: the url of the "player" | |
| * @return - string | |
| * @todo - do some real world testing. | |
| * | |
| **/ | |
| function get_video_thumbnail( $src ) { |
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
| function get_vimeoid( $url ) { | |
| $regex = '~ | |
| # Match Vimeo link and embed code | |
| (?:<iframe [^>]*src=")? # If iframe match up to first quote of src | |
| (?: # Group vimeo url | |
| https?:\/\/ # Either http or https | |
| (?:[\w]+\.)* # Optional subdomains | |
| vimeo\.com # Match vimeo.com | |
| (?:[\/\w:]*(?:\/videos)?)? # Optional video sub directory this handles groups links also | |
| \/ # Slash before Id |
NewerOlder