Skip to content

Instantly share code, notes, and snippets.

View ignotusverum's full-sized avatar
🇺🇦

Vlad Z. ignotusverum

🇺🇦
View GitHub Profile
import UIKit
import SnapKit
import AVFoundation
enum QRReaderError: Error {
case invalidLink
case noQRDetected
case inputNotAvailable
case devideNotAvailable
@ignotusverum
ignotusverum / UICollectionView+Utils.swift
Created August 19, 2021 21:29
Collection view helpers
import Foundation
import UIKit
public extension UICollectionView {
func register<T: UICollectionViewCell>(_ cellClass: T.Type) {
register(cellClass,
forCellWithReuseIdentifier: String(describing: T.self))
}
func registerView<T: UICollectionReusableView>(_ viewClass: T.Type,
// Generated using SwiftGen, by O.Halligon — https://github.com/SwiftGen/SwiftGen
{% if catalogs %}
{% set accessModifier %}public{% endset %}
import UIKit
{% macro enumBlock assets sp %}
{{sp}} {% call casesBlock assets sp %}
{% endmacro %}
{% macro casesBlock assets sp %}
{{sp}} {% for asset in assets %}
@ignotusverum
ignotusverum / filename_subfolder.applescript
Created February 17, 2021 05:13
Update file names based on folder name
set f to choose folder -- Select Master Folder
tell application "Finder"
set subF to every folder of folder f
repeat with eachFolder in subF
set counter to 0
set the_item_name to name of eachFolder
set allFiles to (every file of eachFolder)
@ignotusverum
ignotusverum / folder_for_files.APPLESCRIPT
Created February 17, 2021 05:12
Create folder for files
set sourceFolder to choose folder
tell application "Finder"
set theFiles to files of sourceFolder
repeat with aFile in theFiles
set fileName to name of aFile
if fileName contains "_" then
set poundOffset to offset of "_" in fileName
import Foundation
struct Test1: Codable {
var testDate: Date? = nil
let name: String
let age: Int
enum CodingKeys: String, CodingKey {
case name
@ignotusverum
ignotusverum / Podfile
Last active July 25, 2016 17:42
Cocoa pods for swift 3.0 (add to Podfile)
post_install do |installer|
installer.pods_project.targets.each do |target|
target.build_configurations.each do |configuration|
configuration.build_settings['SWIFT_VERSION'] = "3.0"
end
end
end