Skip to content

Instantly share code, notes, and snippets.

View Ali72's full-sized avatar
🤓
Working from home

Ali khajehpour Ali72

🤓
Working from home
View GitHub Profile
@barisuyar
barisuyar / Slider.swift
Created December 1, 2021 19:56
Complete Slider
import UIKit
final class Slider: UISlider {
private let baseLayer = CALayer() // Step 3
private let trackLayer = CAGradientLayer() // Step 7
override func draw(_ rect: CGRect) {
super.draw(rect)
setup()
@irazasyed
irazasyed / mysq-mariadb-macos-start-issue.md
Created October 7, 2020 00:05
Solution for MySQL / MariaDB Start Issue on MacOS

Solution for MySQL / MariaDB Start Issue on MacOS

Errors

On trying to start mysql.server start

./usr/local/bin/mysql.server: line 264: kill: (12262) - No such process ERROR!

@kazimunshimun
kazimunshimun / ContentView.swift
Created September 10, 2020 19:25
SwiftUI Circular Slider
//
// ContentView.swift
// TemperatureControl
//
// Created by Anik on 10/9/20.
//
import SwiftUI
struct ContentView: View {
@kshivang
kshivang / AVPlayer+Combine.swift
Last active July 10, 2024 16:47
Combine wrapper over AVPlayer.addPeriodicTimeObserver method. Use AVPlayer.periodicTimePublisher method instead.
import AVFoundation
import Combine
// simply use
// player.periodicTimePublisher()
// .receive(on: RunLoop.main)
// .assign(to: \SomeClass.elapsedTime, on: someInstance)
// .store(in: &cancelBag)
@IuriiIaremenko
IuriiIaremenko / Inject.swift
Last active September 4, 2022 10:56
Swift Dependency Injection via Property Wrapper
//
// Inject.swift
//
// Created by Iurii Iaremenko on 11.01.2020.
//
import Foundation
@propertyWrapper
public class Inject<Value> {
@grahampugh
grahampugh / Adobe CC Cleaner-postinstall.sh
Created November 18, 2019 15:06
A script to clean up properly the things that Adobe CC Cleaner fails to remove.
#!/bin/bash
## postinstall script to remove CCDA applications
# remove any existing version of the tool
echo "Moving the CC Cleaner app to Utilities in case users need it later"
rm -rf /Applications/Utilities/Adobe\ Creative\ Cloud\ Cleaner\ Tool.app ||:
mv /Applications/Adobe\ Creative\ Cloud\ Cleaner\ Tool.app /Applications/Utilities/Adobe\ Creative\ Cloud\ Cleaner\ Tool.app
# run the cleaner tool to remove EVERYTHING!
echo "Running the CC Cleaner app with 'removeAll=All' option"
@jmarkstar
jmarkstar / AlamofireCodable.swift
Last active June 6, 2023 16:45
Decode Alamofire response to a Generic codable type but if we get http code 400, I decode different json which is a error message.
@discardableResult
private func performRequest<T:Decodable>(route: APIRouter, decoder: JSONDecoder = JSONDecoder(), completion:@escaping (Int, Result<T>)->Void) -> DataRequest {
return Alamofire.request(route).responseData() { responseData in
guard let response = responseData.response else {
completion(APIClient.responseErrorCode, .failure(ApiError.internalServerError(NSLocalizedString("service_error", comment: AppConstant.EMPTY))))
return
}
@koingdev
koingdev / UIAlertControllerX.swift
Last active October 27, 2022 06:46
Easy way to show UIAlertController with Builder Pattern
extension UIAlertController {
// MARK: - Typealias
typealias Alert = UIAlertController
typealias Action = UIAlertAction
typealias Block = ((Alert) -> Void)?
// MARK: - Static function
@Fazzani
Fazzani / free_m3u8.m3u
Created July 28, 2018 09:13
Free m3u8 streams
http://sample.vodobox.net/skate_phantom_flex_4k/skate_phantom_flex_4k.m3u8
http://playertest.longtailvideo.com/adaptive/wowzaid3/playlist.m3u8
http://cdn-fms.rbs.com.br/vod/hls_sample1_manifest.m3u8
http://nasatv-lh.akamaihd.net/i/NASA_101@319270/index_1000_av-p.m3u8?sd=10&rebase=on
http://content.jwplatform.com/manifests/vM7nH0Kl.m3u8
@hugosenari
hugosenari / BIG iOS URL SCHEME LIST 1.txt
Last active August 21, 2024 00:56 — forked from genadyo/gist:295a5e8f0d743f57137f
Android/IOs Url Schemas
BIG iOS URL SCHEME LIST
HAD TO MAKE A DROPBOX FILE BECAUSE THIS LIST WAS TOO LONG TO POST IN THE COMMENTS OR NOT MAKE THE WORKFLOW APP TAKE FOREVER TO READ IT.
☠JAILBREAK/SYSTEM APPS
--------------------------
activator://
itms-apps://
itms-services://