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 | |
# Input and output file paths | |
INPUT_FILE="api.env" # Replace with your file name | |
OUTPUT_FILE="api-output.env" # The file to write resolved secrets | |
# Clear or create the output file | |
: > "$OUTPUT_FILE" | |
# Process each line in the input file |
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
func Error(val error) slog.Attr { | |
stack := make([]byte, 4096) | |
n := runtime.Stack(stack, false) | |
return slog.Group("error", | |
slog.String("exception.message", val.Error()), | |
slog.String("exception.stacktrace", fmt.Sprintf("%s", stack[:n])), | |
) | |
} |
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
package main | |
import ( | |
"bytes" | |
"fmt" | |
"image/color" | |
"github.com/BolajiOlajide/testrun" | |
"github.com/yeqown/go-qrcode/v2" | |
"github.com/yeqown/go-qrcode/writer/standard" |
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 |
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
fun main() { | |
Repository.startFetch() | |
getResult(Repository.getCurrentState()) | |
Repository.finishFetch() | |
getResult(Repository.getCurrentState()) | |
Repository.error() | |
getResult(Repository.getCurrentState()) | |
} |
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
fun main() { | |
Repository.startFetch() | |
getResult(Repository.getCurrentState()) | |
Repository.finishFetch() | |
getResult(Repository.getCurrentState()) | |
Repository.error() | |
getResult(Repository.getCurrentState()) | |
} |
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
/** | |
* You can edit, run, and share this code. | |
* play.kotlinlang.org | |
*/ | |
fun main() { | |
val myCar = Car() | |
println(myCar.color) | |
println(myCar.model) | |
myCar.drive() | |
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
/** | |
* You can edit, run, and share this code. | |
* play.kotlinlang.org | |
*/ | |
fun main() { | |
val amount = 90 | |
when (amount) { | |
in 1..10 -> println("in between one and ten") | |
!in 11..20 -> println("not in between 11 and 20") |
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
package main | |
import ( | |
"encoding/csv" | |
"fmt" | |
"os" | |
"strings" | |
) | |
func main() { |
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
export function paint(context, t) { | |
const { width, height } = context.canvas; | |
const imageData = context.getImageData(0, 0, width, height); | |
for (let p = 0; p < imageData.data.length; p += 4) { | |
const i = p / 4; | |
const x = i % width; | |
const y = (i / width) >>> 0; | |
const red = 64 + (128 * x) / width + 64 * Math.sin(t / 1000); |
NewerOlder