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); | |
| namespace Macademy\Blog\Api\Data; | |
| use Macademy\Blog\Api\Data\PostInterface; | |
| use Magento\Framework\Api\SearchResultsInterface; | |
| /** | |
| * Blog post search result interface. | |
| * @api |
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
| <?xml version="1.0" encoding="UTF-8"?> | |
| <form xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Ui:etc/ui_configuration.xsd"> | |
| <fieldset name="other_settings"> | |
| <fieldset name="head"> | |
| <field name="head_includes"> | |
| <settings> | |
| <disabled>true</disabled> | |
| </settings> | |
| </field> | |
| </fieldset> |
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); | |
| namespace Macademy\ProductInfo\ViewModel; | |
| use Magento\Catalog\Model\ProductRepository; | |
| use Magento\Framework\App\RequestInterface; | |
| use Magento\Framework\Exception\NoSuchEntityException; | |
| use Magento\Framework\View\Element\Block\ArgumentInterface; | |
| class FilteredAttribute implements ArgumentInterface |
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 | |
| for i in *.mp4; do | |
| [[ $i == *"- clean"* ]] && continue # this line excludes files that contain "- clean" in filename | |
| prefix=`echo "$i" | sed "s/^\([0-9]*\)\.\(.*\)/\1/"`; | |
| ffmpeg -i "$i" -ss 00:00:15.00 -vf "thumbnail,scale=480:270" -frames:v 1 "$prefix.webp" | |
| 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
| #!/bin/bash | |
| course="php-101" | |
| totalcount=0 | |
| for i in *.mp4; do | |
| [[ $i == *"- clean"* ]] && continue | |
| totalcount=$((totalcount+1)) | |
| 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
| content |
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
| import os | |
| import whisper | |
| from whisper.utils import get_writer | |
| input_dir = 'input/' | |
| output_dir = 'output/' | |
| for filename in sorted(os.listdir(input_dir)): | |
| if filename.endswith('.mp4'): | |
| input_file = input_dir + filename |
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
| import os | |
| import textwrap | |
| input_dir = 'input1/' | |
| output_dir = 'output1/' | |
| for filename in sorted(os.listdir(input_dir)): | |
| if filename.endswith('.srt'): | |
| with open(input_dir + filename, 'r') as input_file: | |
| output_filename = output_dir + filename |
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 | |
| # Requires translate-shell to be installed. | |
| # Get it on GitHub at: https://github.com/soimort/translate-shell | |
| # Parse command-line arguments | |
| while [[ "$#" -gt 0 ]]; do | |
| case $1 in | |
| --file|-f ) file="$2"; shift ;; | |
| --language|-l ) language="$2"; shift ;; |
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
| import os | |
| import whisper | |
| from whisper.utils import get_writer | |
| # Get the current directory path | |
| directory = os.getcwd() | |
| # Loop through all the files in the directory | |
| for file in sorted(os.listdir(directory)): | |