Skip to content

Instantly share code, notes, and snippets.

clean and clear

Zaporozhchenko Oleksandr Maxatma

clean and clear
Block or report user

Report or block Maxatma

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
Maxatma / IntrinsicTableView.swift
Created Mar 25, 2020
Self-resizing tableview
View IntrinsicTableView.swift
class IntrinsicTableView: UITableView {
override var contentSize: CGSize {
didSet {
override var intrinsicContentSize: CGSize {
Maxatma / histogram
Created Mar 9, 2020
Figure out appearance count of each element in array
View histogram
extension Array where Element: Hashable {
var histogram: [Element: Int] {
return self.reduce(into: [:]) { counts, elem in counts[elem, default: 0] += 1 }
Maxatma / DumbTest.playground
Created Jan 9, 2019
Swift switch enum problem
View DumbTest.playground
import UIKit
enum DumbTest {
case get(user: String)
case get(pony: String, tail: String)
func getSome() -> String {
switch self {
case .get(let user):
Maxatma / .swift
Created Feb 12, 2018
Cannot convert return expression of type 'Date' to return type 'Date'
View .swift
class Date {
class func from(year: Int, month: Int , day: Int ) -> Date {
let gregorianCalendar = NSCalendar(calendarIdentifier: .gregorian)!
var dateComponents = DateComponents()
dateComponents.year = year
dateComponents.month = month = day
Maxatma / custom thrift install
Last active Apr 10, 2018
Custom Apache Thrift installation guide
View custom thrift install
To install custom thrift ( like swift 3 from,
u will need do all this things probably, otherwise just use
brew install thrift
1. Install homewbrew: /usr/bin/ruby -e "$(curl -fsSL"
2. Install all needed from this:
3. Be sure u installed bison, pkg-config, automake@1.15
4. do ./, if 'automake command not found' - check if u using needed version, if it linked. Try unlink and link again.
5. Check if all needed linked, if not do for example: brew link automake
6. If u got fatal error: 'openssl/err.h' file not found, do: ./configure LDFLAGS='-L/usr/local/opt/openssl/lib' CPPFLAGS='-I/usr/local/opt/openssl/include'
You can’t perform that action at this time.