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 AWS from "aws-sdk"; | |
| AWS.config.region = "us-east-1"; | |
| (async () => { | |
| const lambda = new AWS.Lambda(); | |
| const params = { | |
| FunctionName: "FN-1", | |
| InvocationType: "RequestResponse", | |
| LogType: "Tail", | |
| Payload: |
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
| const axios = require("axios"); | |
| const AWS = require("aws-sdk"); | |
| AWS.config.region = "us-east-1"; | |
| const bucket_id = "BK-1"; | |
| module.exports.main = async (event) => { | |
| const s3 = new AWS.S3(); | |
| await s3 | |
| .putObject({ |
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
| const sleep = async (milliseconds) => { | |
| await new Promise((resolve) => setTimeout(resolve, milliseconds)); | |
| }; |
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
| pm2 start npm --name <name> -- run <script> |
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 getRndInteger(min, max) { | |
| return Math.floor(Math.random() * (max - min) ) + min; | |
| } |
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
| # Remove audio from video file | |
| ffmpeg -i "video.mp4" -c copy -an "output.mp4" | |
| # Merge (video file without audio) with audio file | |
| ffmpeg -i "video.mp4" -i "audio.mp3" -c:v copy -c:a aac "output.mp4" | |
| # Trim video using start/end time (hh:mm:ss) | |
| ffmpeg -ss 00:00:00 -i "video.mp4" -c copy -t 00:00:15 "output.mp4" | |
| # Write text at middle of a video 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
| function extractEmailFromString(text: string): string { | |
| const matches = text.match( | |
| /([a-zA-Z0-9._-]+@[a-zA-Z0-9._-]+\.[a-zA-Z0-9_-]+)/gi | |
| ); | |
| return matches ? matches[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
| import requests | |
| from bs4 import BeautifulSoup | |
| web_url = "https://civitai.com/models/7371/rev-animated" | |
| model_type = "model" | |
| # Get download url | |
| response = requests.get(web_url) | |
| soup = BeautifulSoup(response.text, 'html.parser') | |
| url = soup.select(".mantine-UnstyledButton-root.mantine-Button-root.mantine-1movwzg")[0].get("href") |
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
| from huggingface_hub import HfApi, hf_hub_url | |
| import os | |
| hf_config = { | |
| "username":"", | |
| "repo_name":"", | |
| "token":"" | |
| } | |
| def upload_file_hf(file_path): |
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
| for dir in custom_nodes/*/; do | |
| if [ -d "$dir" ]; then | |
| echo "Entering module: $dir" | |
| (cd $dir && pip install -qq -r requirements.txt) | |
| fi | |
| done |
OlderNewer