Flow Type | Purpose | Key Features | Use Case |
---|---|---|---|
flow {} |
Creates a cold flow that emits values lazily. | Emits values only when collected. Supports suspending functions. |
Creating custom flows to emit data on demand. |
flowOf() |
Creates a flow from a fixed set of values. | Emits provided values sequentially. Cold by nature. |
Emit predefined values (e.g., configuration settings). |
asFlow() |
Converts collections, sequences, arrays, or ranges to flows. | Supports many standard types. Cold by nature. |
Convert lists or arrays into flows for processing. |
`c |
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/sh | |
print_usage() { | |
echo "usage: compress_video <input_file>" | |
echo "supported formats: mp4, webm, mkv, mov, avi, flv" | |
} | |
get_extension() { | |
f="${1##*/}" | |
case "$f" in |
Option | Description | Example |
---|---|---|
-i |
Input file | ffmpeg -i input.mp4 |
-vf |
Video filters (apply effects to video) | ffmpeg -i input.mp4 -vf "scale=1280:720" output.mp4 |
-c:v |
Video codec (specify video compression method) | ffmpeg -i input.mp4 -c:v libx264 output.mp4 |
-c:a |
Audio codec (specify audio compression method) | ffmpeg -i input.mp4 -c:a aac output.mp4 |
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 sys | |
import anthropic | |
from dotenv import load_dotenv | |
load_dotenv() | |
client = anthropic.Anthropic() | |
prompt_template = """ | |
Please review and edit the following text to ensure it is grammatically correct, clear, and concise. Aim to maintain a casual tone without being overly informal. Provide suggestions for improvement and explain any changes you make. Do not add double quotes in you rewrite answer. Answer in direct response. |
For inspiration and ideas for my Math Homework Generator, I figured that I should start a list of pages I should look through eventually to learn about what's out there and what might be lacking. MHG is often found in other lists which is how I found these links.
Custom Resource Makers - Worksheet Generators (Source)
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 | |
IFS=$'\n\t' | |
set -eou pipefail | |
if [[ "$#" -ne 3 || "${1}" == '-h' || "${1}" == '--help' ]]; then | |
cat >&2 <<"EOF" | |
gcr-cleaner.sh will cleans up the gcr tags or untaged images pushed in a repository (image name with the specific tag) | |
and except the given number most recent images. |
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
/** | |
* Create and return a new [Painter] that wraps [painter] with its [alpha], [colorFilter], or [onDraw] overwritten. | |
*/ | |
fun forwardingPainter( | |
painter: Painter, | |
alpha: Float = DefaultAlpha, | |
colorFilter: ColorFilter? = null, | |
onDraw: DrawScope.(ForwardingDrawInfo) -> Unit = DefaultOnDraw, | |
): Painter = ForwardingPainter(painter, alpha, colorFilter, onDraw) |
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
/* | |
* MIT License | |
* | |
* Copyright (c) 2022 Albert Chang | |
* | |
* Permission is hereby granted, free of charge, to any person obtaining a copy | |
* of this software and associated documentation files (the "Software"), to deal | |
* in the Software without restriction, including without limitation the rights | |
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
* copies of the Software, and to permit persons to whom the Software is |
Quick guide on how to setup git signing. Information is aggregated from following sources:
NewerOlder