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 requests | |
import os | |
from datetime import datetime, timezone | |
from dotenv import load_dotenv | |
from strava_oauth import get_tokens | |
# Carrega as variáveis do arquivo .env | |
load_dotenv() | |
# Lê os dados de configuração do app Strava do arquivo .env |
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
# Subtitles Downloader | |
This script downloads subtitles for video files from various sources like OpenSubtitles and TheSubDB. It is designed to fetch the best subtitle available for a video file in your chosen language, specifically for **Portuguese (Brazil)** in this setup. | |
## Dependencies | |
This script requires the following Python libraries: | |
- **subliminal**: A Python library for subtitle downloading. | |
- **babelfish**: A library to handle language codes. | |
- **click**: A command-line utility to manage arguments (optional for advanced use). |
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 RxSwift | |
import RxTest | |
import XCTest | |
@testable import ExampleFramework | |
final class MoviesDefaultViewModelTests: XCTestCase { | |
private var scheduler: TestScheduler! | |
private var observer: TestableObserver<MovieViewState>! | |
private var disposeBag: DisposeBag! |
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 RxSwift | |
public final class MoviesDefaultViewModel: MoviesViewModel { | |
private let viewStateSubject = BehaviorSubject<MovieViewState>(value: .loading) | |
private let disposeBag = DisposeBag() | |
private let repository: MoviesRepository | |
public init(repository: MoviesRepository) { | |
self.repository = repository | |
} |
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 RxSwift | |
public enum MovieViewState: Hashable { | |
case loading | |
case error(error: Error) | |
case showingMovies(titles: [String]) | |
case empty | |
public var hashValue: Int { | |
switch self { |
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
final class ThreadWithRunLoopScheduler: ImmediateSchedulerType { | |
private let thread: ThreadWithRunLoop | |
init(name: String) { | |
thread = ThreadWithRunLoop() | |
thread.name = name | |
thread.start() | |
} | |
func schedule<StateType>(_ state: StateType, action: @escaping (StateType) -> Disposable) -> Disposable { |
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
final class ThreadWithRunLoop: Thread { | |
var runLoop: RunLoop! | |
override func main() { | |
runLoop = RunLoop.current | |
runLoop.add(Port(), forMode: .commonModes) | |
runLoop.run() | |
} | |
} |
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
let realmQueue = DispatchQueue(label: "RealmQueue", qos: .background) | |
let realmScheduler = SerialDispatchQueueScheduler(queue: realmQueue, internalSerialQueueName: "RealmScheduler") |
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
func example() -> Single<String> { | |
let cache = MemoryCacheLevel() | |
.compose(DiskCacheLevel<GithubService, NSData>()) | |
.compose(MoyaFetcher(provider: provider)) | |
return cache.get(GithubService.zen) | |
.asObservable() | |
.map { data -> String in | |
guard let string = String(data: data as Data, encoding: .utf8) else { | |
throw MappingError.string(data) |
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 id="url_install" href="itms-services://?action=download-manifest&url=https://ios.agilepromoter.com.br/_replace_me_/manifest.plist"> | |
<script type="text/javascript"> | |
window.onload = function() { | |
var path = window.location.pathname; | |
path = path.substring(1, path.length - 1); | |
var linkElement = document.getElementById("url_install"); | |
var iOSURL = linkElement.getAttribute("href") | |
NewerOlder