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
public extension View { | |
func bottomSheet<Content: View>(isPresented: Binding<Bool>, title: LocalizedStringKey? = nil, @ViewBuilder content: @escaping () -> Content) -> some View { | |
self.windowOverlay(isKeyAndVisible: isPresented) { | |
if isPresented.wrappedValue { | |
BottomSheet(isPresented: isPresented) { | |
HStack(spacing: 16) { | |
ZStack { | |
Circle() | |
.fill(Color.darkCharcoal) | |
.frame(width: 32, height: 32) |
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
// This sketches a script that will sample images from an AVAsset at a | |
// new framerate. This might be used to transcode a movie or create an | |
// animated GIF. | |
import AppKit | |
import AVFoundation | |
import CoreMedia | |
let FPS = 12 // The target framerate for the new movie. | |
let frameDuration = CMTimeMake(1, Int32(FPS)) |
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 cv2 | |
import numpy as np | |
import pandas as pd | |
import tqdm | |
import imutils | |
import os | |
class VideoStabilizer: | |
def __init__(self, video_in_path, video_out_path, side_by_side=False, crop_percent=None, max_width=500): |
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
devices=( | |
"iPhone 8" | |
"iPhone 8 Plus" | |
"iPhone SE" | |
"iPad Pro (11-inch)" | |
"iPhone Xʀ") | |
workspace="test" |
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 Foundation | |
import GLKit | |
extension UIImage { | |
func checkAndCompressImage(image: UIImage?, _ completion: @escaping (Data?) -> Void) { | |
print("start compress image ....") | |
DispatchQueue.global(qos: .background).async { | |
let imagecompress = UIImage.compressImage(image, compressRatio: 0.5) |
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
class TaskCodableModel: Codable { | |
var id: String? | |
var createDate: Date? | |
var name: String | |
var isFinished: Bool | |
var subtasks: Int | |
var weight: Double | |
var children: [String]? | |
var description: String? |
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
// | |
// BaseUploadOperation.swift | |
// UHive | |
// | |
// Created by Ahmad AlMasri on 6/27/19. | |
// Copyright © 2019 Genie9. All rights reserved. | |
// | |
import Foundation |
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 android.util.Base64; | |
import java.io.UnsupportedEncodingException; | |
import java.security.InvalidAlgorithmParameterException; | |
import java.security.InvalidKeyException; | |
import java.security.MessageDigest; | |
import java.security.NoSuchAlgorithmException; | |
import java.security.SecureRandom; | |
import java.util.Arrays; | |
import java.util.Random; |
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
class SNZoomScrollView: UIScrollView { | |
// MARK: Class properties | |
var imageView:UIImageView = UIImageView() | |
var imageToDisplay:UIImage? = nil{ | |
didSet{ | |
zoomScale = 1.0 | |
minimumZoomScale = 1.0 | |
imageView.image = imageToDisplay |
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
// | |
// KeychainItemAccessibility.swift | |
// | |
// Created by Ahmad AlMasri on 3/7/19. | |
// Copyright © 2019 Snapics App. All rights reserved. | |
// | |
//Ref @URL : https://github.com/twostraws/HackingWithSwift/blob/master/project28/Project28/KeychainItemAccessibility.swift | |
import Foundation |
NewerOlder