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
// | |
// View+OpenUrl.swift | |
// | |
// Created by James Sedlacek on 11/26/24. | |
// | |
/// This file provides a safe way to open URLs in SwiftUI applications. | |
/// It adds a view modifier that handles URL opening with user confirmation | |
/// and multiple opening options (browser, in-app, or copy to clipboard). | |
/// |
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/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 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
class FPSCounter extends StatefulWidget { | |
const FPSCounter({super.key}); | |
@override | |
State<FPSCounter> createState() => _FPSCounterState(); | |
} | |
class _FPSCounterState extends State<FPSCounter> { | |
int fps = 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
const double minLightness = 0.30; | |
const double maxLightness = 0.55; | |
const double lightnessRange = maxLightness - minLightness; | |
const int numberOfColors = 3; | |
/// The top card gradients logic | |
/// | |
/// Generate a list of gradient colors based on the provided [originalColor]. | |
/// This function generates three gradient colors by adjusting the lightness of the [originalColor]. | |
List<Color> generateGradientColors(Color originalColor) { |
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 'dart:math'; | |
import 'package:flutter/material.dart'; | |
void main() { | |
runApp(const MyApp()); | |
} | |
class MyApp extends StatelessWidget { | |
const MyApp({super.key}); |
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 'dart:math'; | |
import 'package:flutter/material.dart'; | |
import 'package:flutter/rendering.dart'; | |
void main() { | |
runApp(MyApp()); | |
} | |
class MyApp extends StatelessWidget { | |
@override |
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
/// A short-lived [value] `T`, that conditionally is re-computed or re-fetched. | |
class Ephemeral<T> { | |
final Future<T> Function() _fetch; | |
final bool Function(T) _isExpired; | |
/// Returns [value] by invoking [fetch]. | |
/// | |
/// If [isExpired] returns `false` for a given value, the value is re-fetched. | |
/// | |
/// ``` |
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
/// ANSI escape sequence constants. | |
/// | |
/// See also: | |
/// - <https://vt100.net/docs/vt100-ug/chapter3.html>. | |
/// - <https://www.lihaoyi.com/post/BuildyourownCommandLinewithANSIescapecodes.html> | |
library ansi; | |
/// Provides constants for 16-bit colors and styles using ANSI-escape sequences. | |
enum AnsiEscapes16Bit { | |
/// Resets all styled output after this escape sequence. |
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
default_platform(:ios) | |
APPLE_ISSUER_ID = ENV["APPLE_ISSUER_ID"] | |
APPLE_KEY_CONTENT = ENV["APPLE_KEY_CONTENT"] | |
APPLE_KEY_ID = ENV["APPLE_KEY_ID"] | |
DEVELOPER_APP_ID = ENV["DEVELOPER_APP_ID"] | |
DEVELOPER_APP_IDENTIFIER = ENV["DEVELOPER_APP_IDENTIFIER"] | |
GIT_AUTHORIZATION = ENV["GIT_AUTHORIZATION"] | |
GITHUB_RUN_NUMBER = ENV["GITHUB_RUN_NUMBER"] | |
PROVISIONING_PROFILE_SPECIFIER = ENV["PROVISIONING_PROFILE_SPECIFIER"] |
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
extension IdentableStringSink on StringSink { | |
/// Provides a delegating implementation of [StringSink] on [invoke]. | |
/// | |
/// ``` | |
/// String example(String name, int age) { | |
/// final sink = StringBuffer(); | |
/// sink | |
/// ..writeln('Identification') | |
/// ..indent(2, (sink) { | |
/// sink |
NewerOlder