Skip to content

Instantly share code, notes, and snippets.

View stakancheck's full-sized avatar
🤯
Work&Study

Artem Sukhanov stakancheck

🤯
Work&Study
View GitHub Profile

Keybase proof

I hereby claim:

  • I am stakancheck on github.
  • I am stakancheck (https://keybase.io/stakancheck) on keybase.
  • I have a public key ASAT6b6fLBbG5MVSXlcrsYel1lN1zgxgiLhr8BvQMXE42Qo

To claim this, I am signing this object:

@stakancheck
stakancheck / AuthScreen.swift
Last active June 30, 2023 13:42
Binding for moko filed from any place
// ADD THIS CODE
struct Binder {
private static func binding<T, R>(
mutable: CMutableStateFlow<T>,
viewModel: ViewModel,
equals: @escaping (T?, T?) -> Bool,
getMapper: @escaping (T) -> R,
setMapper: @escaping (R) -> T
) -> Binding<R> {
GeoIPFile "C:/tor/data/geoip"
GeoIPv6File "C:/tor/data/geoip6"
ExcludeNodes {ru}, {by}, {ua}, {kz}
StrictNodes 1
GeoIPExcludeUnknown 1
ExitNodes {de}, {fr}, {fi}, {nl}, {nz}, {no}, {ch}, {se}, {dk}, {ee}
ClientTransportPlugin obfs2,obfs3,obfs4,scramblesuit exec C:\tor\tor\pluggable_transports\obfs4proxy.exe
Bridge obfs4 ...
Bridge obfs4 ...
@stakancheck
stakancheck / MapViewController.swift
Last active January 23, 2024 17:40
MapViewController.swift (iosApp)
import Foundation
import YandexMapsMobile
import ComposeApp
import UIKit
class MapViewController: UIViewController {
private let locationMark: UIImage = UIImage(named: "location_mark")!
private let myLocatioPoint: UIImage = UIImage(named: "my_location_point")!
@stakancheck
stakancheck / YandexMapView.ios.kt
Last active January 23, 2024 17:44
YandexMapView.ios.kt (iosMain)
@OptIn(ExperimentalForeignApi::class)
@Composable
actual fun YandexMap(
modifier: Modifier,
enabled: Boolean,
zoom: Float,
location: LatLng?,
startPosition: LatLng?,
points: List<PointMapModel>,
onPointClick: (id: Long) -> Unit,
@stakancheck
stakancheck / YandexMapProtocol.kt
Last active January 23, 2024 17:27
YandexMapProtocol.kt (iosMain)
interface YandexMapProtocol {
val viewController: UIViewController
fun addCameraListener(onDragged: () -> Unit)
fun addMapListener(onPositionSelect: (latitude: Double, longitude: Double) -> Unit)
fun addMapPointListener(onPointClick: (id: Long) -> Unit)
@stakancheck
stakancheck / YandexMapProtocolImpl.swift
Created January 27, 2024 13:26
YandexMapProtocolImpl (iosApp)
class YandexMapProtocolImpl: YandexMapProtocol {
var mapViewController: MapViewController
var viewController: UIViewController
init() {
self.mapViewController = MapViewController()
self.viewController = (self.mapViewController as UIViewController)
}
func addCameraListener(onDragged: @escaping () -> Void) {
@stakancheck
stakancheck / PDFGenerator.kt
Created April 17, 2024 11:49
PDFGenerator example
class PdfGenerator(private val context: Context) {
private val htmlToPdfConvertor = HtmlToPdfConvertor(context)
// Функция генерации и сохранения
suspend fun generateExpertAct(
act: ActSave,
images: List<File>,
outFile: File
): Result<Unit> {
return suspendCoroutine { continuation ->
@stakancheck
stakancheck / HtmlToPdfConvertor.kt
Last active April 22, 2024 23:29
HtmlToPdfConvertor example
class HtmlToPdfConvertor(private val context: Context) {
private var enableJavascript: Boolean? = null
// Экземпляр WebView с базовыми настройками
private val pdfWebView = WebView(context).apply {
this.settings.allowContentAccess = true
this.settings.allowFileAccess = true
this.settings.cacheMode = WebSettings.LOAD_NO_CACHE
}
fun setJavaScriptEnabled(flag: Boolean) {
@stakancheck
stakancheck / GeneratePDFWorker.kt
Created April 17, 2024 12:35
GeneratePDFWorker example
@HiltWorker
class GeneratePDFWorker @AssistedInject constructor(
@Assisted context: Context,
@Assisted params: WorkerParameters,
private val repository: Repository
) : CoroutineWorker(context, params) {
private val notificationBuilder: NotificationCompat.Builder
private var pdfGenerator: PdfGenerator? = null