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
(() => { | |
let isVideoHandled = false; // Flag to indicate if the video has been handled | |
const checkVideoStart = () => { | |
const video = document.querySelector('#movie_player > div.html5-video-container > video'); | |
if (!video) return; | |
// When the video starts playing (currentTime changes from 0), pause it | |
if (video.currentTime > 0 && !video.paused) { | |
video.pause(); |
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
(() => { | |
let isInitialized = false; // Flag to indicate if the initial pause has been done | |
const pauseVideo = () => { | |
if (isInitialized) return; // If the initial pause has been done, do nothing further | |
const video = document.querySelector('#movie_player > div.html5-video-container > video'); | |
// Pause the video if it's found and playing, and then perform cleanup | |
if (video && !video.paused) { |
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 | |
# Create directories and files | |
mkdir -p ./components/ui | |
mkdir -p ./lib | |
touch ./lib/utils.ts | |
# Prompt to move globals.css | |
echo "Would you like to move globals.css to styles/globals.css? (y/n)" | |
read -r -p "[Y/n]: " move_response |
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
// @ts-nocheck | |
import fs from 'fs' | |
import path from 'path' | |
import readline from 'readline' | |
import ts from 'typescript' | |
// Read directory path from command-line arguments or ask for it | |
let componentsDirectoryPath = process.argv[2] | |
if (!componentsDirectoryPath) { | |
const rl = readline.createInterface({ |
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
'use server' | |
import { z } from 'zod' | |
export default async function serverActionOnFormData(formData: FormData) { | |
// Get the form data into a javascript object | |
const form = Object.fromEntries(formData.entries()) | |
// Validate input with zod by passing the form object to the schema | |
const inputSchema = z.object({ | |
id: z.string().uuid(), |
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
// @ts-nocheck | |
const fs = require('fs') | |
const path = require('path') | |
const readline = require('readline') | |
const ts = require('typescript') | |
// Read directory path from command-line arguments or ask for it | |
let componentsDirectoryPath = process.argv[2] | |
if (!componentsDirectoryPath) { | |
const rl = readline.createInterface({ |
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 re | |
def convert_to_json_like(input_str): | |
# Preprocess the input by removing quotes and condensing spaces | |
input_str = re.sub(r'[\'"]', '', input_str) | |
input_str = re.sub(r'\s+', ' ', input_str).strip() | |
# Initialize variables | |
new_str = [] | |
looking_for_first_alpha = True |
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
[ | |
{"name": "Steampunk", "description": "Inspired by 19th-century industrial steam-powered machinery and the aesthetics of the Victorian era."}, | |
{"name": "Furries", "description": "Interested in anthropomorphic animal characters with human personalities and characteristics."}, | |
{"name": "Cosplay", "description": "Dress up and role-play as characters from movies, TV shows, anime, manga, video games, and more."}, | |
{"name": "Goth", "description": "Originating from the post-punk scene in the 1980s, characterized by a fascination with the macabre, romanticism, and dark aesthetics."}, | |
{"name": "Lolita", "description": "Originating in Japan, characterized by wearing clothing inspired by the Rococo and Victorian eras."}, | |
{"name": "Biohackers", "description": "Individuals who seek to enhance their bodies with a combination of medical, nutritional, and electronic techniques."}, | |
{"name": "Freegans", "description": "People who employ alternative strategies for living based on limited participatio |