Skip to content

Instantly share code, notes, and snippets.

Alexey Gordeev Vladlex

Block or report user

Report or block Vladlex

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View AttributedStringIssue.playground
import UIKit
struct GuiUtils {
static func setAttributedStringToSize(attributedString: NSAttributedString, size: CGFloat) -> NSMutableAttributedString {
let mus = NSMutableAttributedString(attributedString: attributedString)
mus.enumerateAttribute(.font, in: NSRange(location: 0, length: mus.string.count)) { (value, range, stop) in
if let oldFont = value as? UIFont {
let newFont = oldFont.withSize(size)
mus.addAttribute(.font, value: newFont, range: range)
View UIImage+Flip.swift
public extension UIImage {
public struct FlipOptions: OptionSet {
public typealias RawValue = Int
public let rawValue: RawValue
public init(rawValue: RawValue) {
self.rawValue = rawValue
#21. Crashed:
0 libsystem_kernel.dylib 0x19e9dd104 __pthread_kill + 8
1 libsystem_pthread.dylib 0x19ea5ca00 pthread_kill$VARIANT$armv81 + 296
2 libsystem_c.dylib 0x19e934d78 abort + 140
3 libswiftCore.dylib 0x1063af07c swift::warning(unsigned int, char const*, ...) + 54
4 libswiftCore.dylib 0x1063af180 swift::swift_abortRetainUnowned(void const*) + 32
5 libswiftCore.dylib 0x1063e0968 swift_unknownUnownedTakeStrong + 70
6 DLGPicker 0x100c631cc partial apply for closure #1 in TelegramPickerViewController.checkStatus() (TelegramPickerViewController.swift:491)
7 DLGPicker 0x100bda3a8 closure #1 in static Assets.requestAccess(_:) (Assets.swift:89)
8 DLGPicker 0x100bda3dc _T0SC21PHAuthorizationStatusOIegy_ABIeyBy_TR (Assets.swift)
Vladlex / gist:ea02dba926feeb369edd621be424dc52
Created Dec 5, 2017
RxSwift Extension: Collect until no event comes in a given time interval
View gist:ea02dba926feeb369edd621be424dc52
public extension Observable {
/// Returns an observable which collects incoming events and fires if no new event comes in a desired time
/// - Parameters:
/// - delay: Value for debouncing (interval that should being passed, a)
/// - bufferMutator: block to mutate collected events. If nil – then new evens just being added to buffer.
/// - Returns: an observable which collects incoming events and fires if no new event comes in a desired time.
public func collect(untilNoEventComesIn delay: RxTimeInterval, bufferMutator:((inout [E], E)->())? = nil) -> Observable<[E]> {
You can’t perform that action at this time.