Skip to content

Instantly share code, notes, and snippets.

View mrugeshtank's full-sized avatar
🎯
Focusing

Mrugesh Tank mrugeshtank

🎯
Focusing
View GitHub Profile
@mrugeshtank
mrugeshtank / webcrypto-examples.md
Created July 22, 2022 05:54 — forked from pedrouid/webcrypto-examples.md
Web Cryptography API Examples
@mrugeshtank
mrugeshtank / Makefile
Created July 15, 2022 12:29 — forked from uhooi/Makefile
Makefile for iOS App development
PRODUCT_NAME := Foo
SCHEME_NAME := ${PRODUCT_NAME}
WORKSPACE_NAME := ${PRODUCT_NAME}.xcworkspace
UI_TESTS_TARGET_NAME := ${PRODUCT_NAME}UITests
TEST_SDK := iphonesimulator
TEST_CONFIGURATION := Debug
TEST_PLATFORM := iOS Simulator
TEST_DEVICE ?= iPhone 11 Pro Max
TEST_OS ?= 13.3
@mrugeshtank
mrugeshtank / addObservers.swift
Created July 8, 2022 07:52 — forked from netgfx/addObservers.swift
Add observers to AVPlayer
// listening for current item change
self.audioQueueObserver = self.playerQueue?.observe(\.currentItem, options: [.new]) {
[weak self] (player, _) in
print("media item changed...")
}
// listening for current item status change
self.audioQueueStatusObserver = self.playerQueue?.currentItem?.observe(\.status, options: [.new, .old], changeHandler: {
(playerItem, change) in
if playerItem.status == .readyToPlay {
@mrugeshtank
mrugeshtank / Font+Autoregistering.swift
Last active May 22, 2022 20:35 — forked from mackoj/Font+Autoregistering.swift
This will allow you to load font that are resources in a SPM module
import Foundation
import UIKit
public struct Resource {
var name: String
var fileExtension: String
var url: URL? {
Bundle.module.url(forResource: name, withExtension: fileExtension)
}
}
extension UserDefaults {
subscript<T>(key: String) -> T? {
get {
return value(forKey: key) as? T
}
set {
set(newValue, forKey: key)
}
}
import Foundation
class KeyboardAppearListener {
private var showKeyboard: NotificationToken?
private var hideKeyboard: NotificationToken?
private weak var viewController: UIViewController?
private var windowSafeArea: CGFloat = 0
private var windowsSafeAreaWereAdded = false
@mrugeshtank
mrugeshtank / database.rules.json
Created March 29, 2019 11:17 — forked from codediodeio/database.rules.json
Common Database Rules for Firebase
// No Security
{
"rules": {
".read": true,
".write": true
}
}
@mrugeshtank
mrugeshtank / README.md
Created December 29, 2018 05:30 — forked from lopspower/README.md
Hexadecimal color code for transparency

Hexadecimal color code for transparency

Twitter

How to set transparency with hex value ?

For example, you want to set 40% alpha transparence to #000000 (black color), you need to add 66 like this #66000000.

All hex value from 100% to 0% alpha:

@mrugeshtank
mrugeshtank / Playground.swift
Created November 28, 2018 13:24 — forked from tikipatel/Playground.swift
Quick Playground for adding rows to the top of a tableview
import PlaygroundSupport
import UIKit
class TableViewManager: NSObject, UITableViewDataSource, UITableViewDelegate {
weak var tableView: UITableView?
var strings = ["a", "b", "c", "d","e", "f", "g", "h","i", "j", "k", "dl","am", "bn", "co", "dp","aq", "br", "cs", "dt","au", "bv", "cw", "dx","ay", "bz", "caa", "dbb","acc", "bdd", "cee", "dff","agg", "bhh", "cii", "djj","akk", "bll", "cmm", "dnn","aoo", "bpp", "cqq", "zrr"]
func add(data: [String]) {