This file contains 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 | |
# Usage: ./extract_frame.sh [path_to_video] [frame_time] | |
# - path_to_video: The path to the video file. | |
# - frame_time: The specific time in the video to capture a frame, in seconds (e.g., "00:01:23" or "90" for 90 seconds). | |
# Default is the last frame. | |
# Check for required tools: ffmpeg and pngpaste | |
if ! command -v ffmpeg &> /dev/null; then | |
echo "ffmpeg is required but not installed. Install it with 'brew install ffmpeg'." |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains 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
animals = { | |
"cow": r""" | |
\ ^__^ | |
\ (oo)\_______ | |
(__)\ )\/\ | |
||----w | | |
|| || | |
""", | |
"donkey": r""" | |
\ |
This file contains 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 | |
import sys | |
def parse_vtt_to_flat(filename): | |
try: | |
with open(filename, 'r', encoding='utf-8') as file: | |
content = file.read() | |
# Remove WEBVTT header and empty lines | |
content = re.sub(r'WEBVTT.*?\n\n', '', content, flags=re.DOTALL) |
This file contains 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 | |
# Check if enough arguments are passed | |
if [ "$#" -ne 3 ]; then | |
echo "Usage: $0 <source_video> <frame_interval> <change_percentage>" | |
exit 1 | |
fi | |
# Assign the arguments to variables | |
SOURCE_VIDEO="$1" |
This file contains 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 desiredFonts = ["Quattrocento Sans","Proxima Nova"]; | |
function checkFontUsage() { | |
// Access the active presentation | |
var presentation = SlidesApp.getActivePresentation(); | |
var slides = presentation.getSlides(); | |
// Define the desired font | |
// Iterate through all slides |
This file contains 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
#!/usr/bin/env bash | |
# Default values | |
FRAME_RATE=4 # Default frame rate (every nth frame) | |
SSIM_THRESHOLD=0.98 # Threshold below which frames are considered different | |
TARGET_WIDTH="" # Target width for frames in the GIF, empty means original width | |
TARGET_HEIGHT="" # Target height for frames in the GIF, empty means original height | |
INPUT_FILE="" # Input filename | |
OUTPUT_GIF="" # Output filename | |
CLEAN_FRAMES=false # Whether to clean up the frames folder |
This file contains 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
// Takes an HTML table from a page that may be layed out as follows: | |
// | Zoe | Brenda | | | |
// | Adam | Arthur | Bob | | |
// | Joe | Zoe | | |
// and lays them out like this | |
// | Adam | Arthur | Brenda | | |
// | Bob | Joe | Zoe | | |
// | |
var templates = { | |
table: (data) => `<table class="ms-rteTable-default" width="100%" cellspacing="0">${data}</table>`, |
This file contains 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: Office Online Content Control Issue | |
description: Test an issue in Office Online. | |
host: WORD | |
api_set: {} | |
script: | |
content: | | |
$("#copy").click(() => tryCatch(copy)); | |
$("#paste").click(() => tryCatch(paste)); | |
let xmlContent = null; |
This file contains 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
/* euclidean GCD (feel free to use any other) */ | |
function gcd(a,b) {if(b>a) {temp = a; a = b; b = temp} while(b!=0) {m=a%b; a=b; b=m;} return a;} | |
/* ratio is to get the gcd and divide each component by the gcd, then return a string with the typical colon-separated value */ | |
function ratio(x,y) {c=gcd(x,y); return ""+(x/c)+":"+(y/c)} | |
/* fix it so the shortest side is always first */ | |
function rotatedRatio(x,y) {var bx=x;if(x>y){x=y;y=bx;} return ratio(x,y)} | |
/* eg: |
NewerOlder