Skip to content

Instantly share code, notes, and snippets.

//
// JSONMapper.swift
// PitukuWM
//
// Created by Azam Mukhtar on 12/12/23.
//
import Foundation
import OSLog
import Foundation
import OSLog
import SwiftUI
final class HTTPClient: ObservableObject {
private let logger = Logger(subsystem: "com.HTTPClient", category: "HTTPClient")
private let session: URLSession
This file has been truncated, but you can view the full file.
PhaseScriptExecution Multiplatform\ Build /Users/jawasoft/Library/Developer/Xcode/DerivedData/FDManager-evdaaakoxjwwlberzguzentcxrnd/Build/Intermediates.noindex/ArchiveIntermediates/Framework/IntermediateBuildFilesPath/JawaForm.build/Release-iphoneos/Framework.build/Script-80BD5CE01A6F887400478D2A.sh (in target 'Framework' from project 'JawaForm')
cd /Users/jawasoft/Documents/Work/FDManager/JawaForm
export ACTION\=install
export AD_HOC_CODE_SIGNING_ALLOWED\=NO
export ALLOW_TARGET_PLATFORM_SPECIALIZATION\=NO
export ALTERNATE_GROUP\=staff
export ALTERNATE_MODE\=u+w,go-w,a+rX
export ALTERNATE_OWNER\=jawasoft
export ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES\=YES
export ALWAYS_SEARCH_USER_PATHS\=NO
import XCTest
@testable import Catastrophic
class CatViewModelTests: XCTestCase {
func test_load_viewModelGetAllData() {
let cats = [anyCat(id: 123), anyCat(id: 34), anyCat(id: 34)]
let sut = makeSUT(with: cats)
extension ItemWebsiteTableViewCell: UITextFieldDelegate {
func textField(_ textField: UITextField,
shouldChangeCharactersIn range: NSRange,
replacementString string: String) -> Bool {
if !textField.text.isFilled,
!string.hasPrefix("https://"),
!string.hasPrefix("http://")
{
//
// MLKitTextRecognizerTests.swift
// SimpleMathCamTests
//
// Created by Azam Mukhtar on 10/03/23.
//
import XCTest
@testable import SimpleMathCam
@zmkhtr
zmkhtr / RumbleEmbedVideoURLExtractor.swift
Last active May 22, 2023 21:52
Rumble Embed Video URL Extractor Swift
/*
I Just, realize we cannot use the content ID for embed video id
https://rumble.com/v2c4m5a-pre-fight-press-conference-power-slap-1-finale.html <- the ID {v2c4m5a}
We cannot simply make the embed URL with that ID because the Embed video URL is using different ID,
here is the embed Video URL for that html content : https://rumble.com/embed/v29j6ea <- the embed ID {v29j6ea}
See there is different id there.
So we need to request/download the page/web with URL session in order to get the embed id from the HTML response.
import Foundation
import UIKit
struct Feed {
let id: String
}
protocol FeedLoader {
func getFeedData(completion: (Swift.Result<Feed, Error>) -> Void)
}
// Pembuatan URL dipindah menjadi parameter.
func getGhibliMovieList(url: URL, completion: @escaping (Swift.Result<[RemoteMovie], Error>) -> Void) {
// Membuat URLSession
URLSession.shared.dataTask(with: url) { [weak self] (data, response, error) in
guard self != nil else { return }
DispatchQueue.main.sync { // Dispatch ke Main Thread
if let data = data,
let response = response as? HTTPURLResponse,
response.statusCode == 200 { // Handling response status code
do {
class URLSessionHTTPClient {
private let session: URLSession
public init(session: URLSession) {
self.session = session
}
public func get(from url: URL, completion: @escaping (Swift.Result<(Data, HTTPURLResponse), Error>) -> Void) {
session.dataTask(with: url) { data, response, error in
completion(Result {