A list of useful commands for the FFmpeg command line tool.
Download FFmpeg: https://www.ffmpeg.org/download.html
Full documentation: https://www.ffmpeg.org/ffmpeg.html
package com.your.package.name; | |
import android.app.Activity; | |
import com.anjlab.android.iab.v3.BillingProcessor; | |
// This singleton class is designed to fix this issue: https://github.com/anjlab/android-inapp-billing-v3/issues/503 | |
// the solution is based on this suggestion: https://github.com/anjlab/android-inapp-billing-v3/issues/501#issuecomment-962612355 | |
public class BillingHolder { |
import SwiftUI | |
import Combine | |
public struct ChangeObserver<V: Equatable>: ViewModifier { | |
public init(newValue: V, action: @escaping (V) -> Void) { | |
self.newValue = newValue | |
self.newAction = action | |
} | |
private typealias Action = (V) -> Void |
struct ExpandableButtonPanel: View { | |
let primaryItem: ExpandableButtonItem | |
let secondaryItems: [ExpandableButtonItem] | |
private let noop: () -> Void = {} | |
private let size: CGFloat = 70 | |
private var cornerRadius: CGFloat { | |
get { size / 2 } | |
} |
// | |
// View+Geometry.swift | |
// SwiftUIKit | |
// | |
// Created by Daniel Saidi on 2020-03-26. | |
// Copyright © 2020 Daniel Saidi. All rights reserved. | |
// | |
import SwiftUI |
import SwiftUI | |
extension View { | |
func eraseToAnyView() -> AnyView { | |
AnyView(self) | |
} | |
} | |
struct SizePreferenceKey: PreferenceKey { | |
typealias Value = CGSize |
import SwiftUI | |
struct ToastView: View { | |
@State private var liked: Bool = false | |
var body: some View { | |
VStack { | |
LikeButton(liked: $liked) | |
} | |
.toast(isShowing: $liked, text: Text("Hello toast!")) |
public class PathUtils { | |
/** | |
* To get URI from Path | |
* | |
* @param context context | |
* @param file file | |
* @return Uri | |
*/ | |
public static Uri getUriFromPath(Context context, File file) { | |
String filePath = file.getAbsolutePath(); |
################################################################################ | |
# sox cheat sheet | |
################################################################################ | |
# Example commands for the sox command-line audio processing tool, | |
# for manipulating or batch processing audio files. | |
################################################################################ | |
# Daniel Jones <[email protected]> | |
################################################################################ | |
################################################################################ |
A list of useful commands for the FFmpeg command line tool.
Download FFmpeg: https://www.ffmpeg.org/download.html
Full documentation: https://www.ffmpeg.org/ffmpeg.html
func emojiToImage(text: String, size: CGFloat) -> UIImage { | |
let outputImageSize = CGSize.init(width: size, height: size) | |
let baseSize = text.boundingRect(with: CGSize(width: 2048, height: 2048), | |
options: .usesLineFragmentOrigin, | |
attributes: [.font: UIFont.systemFont(ofSize: size / 2)], context: nil).size | |
let fontSize = outputImageSize.width / max(baseSize.width, baseSize.height) * (outputImageSize.width / 2) | |
let font = UIFont.systemFont(ofSize: fontSize) | |
let textSize = text.boundingRect(with: CGSize(width: outputImageSize.width, height: outputImageSize.height), | |
options: .usesLineFragmentOrigin, |