Skip to content

Instantly share code, notes, and snippets.


Valerii Pavlov e5faf2

  • Russia, Samara
View GitHub Profile
e5faf2 / File.swift
Created Feb 26, 2018
if let "overload" case
View File.swift
import Foundation
var t1: [NSNumber]?
var t2: [String]? = ["test1","test2"]
if let t = (t1 as [AnyObject]?) ?? (t2 as [AnyObject]?)
if (t.count > 1)
print("ok, we have \(t.count) elements")
e5faf2 /
Created Jan 9, 2013
Clear all .svn catalogs from folder with hierarchy
find . -name ".svn" -exec rm -rf {} \;
e5faf2 /
Last active May 10, 2021
Fast clear Derived Data folder for Xcode
## Edit your ~/.bash_profile and add this code:
rm -rf ~/Library/Developer/Xcode/DerivedData
echo "Removed all derived data."
## Apply new added command by
source ~/.bash_profile
e5faf2 / CharSpacingUILabel.h
Last active Jul 14, 2017
UILabel with custom character spacing
View CharSpacingUILabel.h
/* This UILabel subclass supports custom character spacing for all unicode symbols. Its draws letters as glyphs. */
@interface CharSpacingUILabel : UILabel
CGFloat characterSpacing;
@property CGFloat characterSpacing;