Skip to content

Instantly share code, notes, and snippets.

View saroar's full-sized avatar
🏠
Working from home

Saroar Khandoker saroar

🏠
Working from home
View GitHub Profile
@saroar
saroar / PolandVisaScript
Created September 3, 2023 22:37 — forked from ThiccPadx/PolandVisaScript
Script for Poland Visa appointment booking. Help me everyone to decode this script so that i can make it work again. If any of you is experienced in coding comment here.
// ==UserScript==
// @name Poland Visa Script
// @namespace e-konsulat.gov.pl
// @include https://*.e-konsulat.gov.pl/*
// @grant none
// @author Intekhab Alam (Intek13x_)
// @description Useless to me, may be useful to you..
// @version 0.07
// ==/UserScript==
@saroar
saroar / Async.swift
Created December 22, 2022 07:20 — forked from brennanMKE/Async.swift
Blocking with Semaphores and DispatchGroups in Swift
import PlaygroundSupport
import Foundation
class Worker {
private let queue = DispatchQueue.global(qos: .background)
private let serialQueue = DispatchQueue(label: "com.acme.serial")
public private(set) var count = 0
func incrementCount() {
import ComposableArchitecture
import Dependencies
import SwiftUI
// Based on Isowords's `ComposableGameCenter.LiveKey.LocalPlayerClient.live`:
// https://github.com/pointfreeco/isowords/blob/main/Sources/ComposableGameCenter/LiveKey.swift#L80
struct AuthClient {
enum AuthStatus {
case loggedIn
import Combine
import ComposableArchitecture
import KeyboardShortcuts
public struct KeyboardShortcutManager {
public enum Action: Equatable {
case onKeyDown(UUID)
case onKeyUp(UUID)
}
@saroar
saroar / URL+Extensions.swift
Created September 27, 2022 07:37 — forked from jianghaoyuan2007/URL+Extensions.swift
The extensions for URL in Swift.
import Foundation
extension URL {
/// 返回不带有任何参数的 URL
/// let anURLString = "https://127.0.0.1:8080/search/index.html?type=ios&version=1.0"
/// let anURL = URL.init(string: anURLString)!
/// print(anURL.bareURL)
/// Optional(https://127.0.0.1:8080/search/index.html)
var bareURL: URL? {
import SwiftUI
import Foundation
import CoreGraphics
import AVFoundation
import VideoToolbox
import ComposableArchitecture
struct ContentView: View {
let store: Store<CameraState, CameraAction>
@saroar
saroar / sourcery-generate-app-secrets.sh
Created September 11, 2021 17:39 — forked from lordcodes/sourcery-generate-app-secrets.sh
Read secrets into your iOS project from xcconfig files and then use Sourcery to generate a source file to use them within your code.
#!/bin/bash
# Generate list of arguments to pass to Sourcery
function sourceryArguments {
# Environment variables from BuildConfig to map into AppSecrets
local arguments=(
"CHAT_API_CLIENT_SECRET" "ANALYTICS_WRITE_KEY"
)
local combinedArgs
@saroar
saroar / build-xcframework.sh
Created June 17, 2021 07:48 — forked from quangDecember/build-xcframework.sh
Build XCFramework (universal) framework, create new Aggregate target, add to New Run Script Phase
env > env.txt
instruments -s devices > devices.txt
#! /bin/sh -e
# This script demonstrates archive and create action on frameworks and libraries
# Based on script by @author Boris Bielik
# Release dir path
OUTPUT_DIR_PATH="${PROJECT_DIR}/XCFramework"
function archivePathSimulator {
@saroar
saroar / UIStoryboard.swift
Created June 7, 2021 12:10 — forked from alexj70/UIStoryboard.swift
UIStoryboard extension
import UIKit
extension UIStoryboard {
/// Main storyboard
public var main: UIStoryboard {
return UIStoryboard(name: "Main", bundle: nil)
}
/// Instantiates and returns the view controller with the specified identifier.
///
/// - Parameter identifier: uniquely identifies equals to Class name
@saroar
saroar / Update .gitignore
Created October 12, 2020 16:23 — forked from c33k/Update .gitignore
Updating .gitignore and cleaning the cache
//First commit any outstanding code changes, and then, run this command:
git rm -r --cached .
//This removes any changed files from the index(staging area), then just run:
git add .
//Commit
git commit -m "Atualizando .gitignore para..."