Skip to content

Instantly share code, notes, and snippets.

View AlexeyShevchenko's full-sized avatar

Aleksey Shevchenko AlexeyShevchenko

View GitHub Profile
@mbinna
mbinna / podforceupdate.sh
Created December 4, 2012 09:43
Clear CocoaPods cache, re-download and re-install all pods
#!/usr/bin/env bash
rm -rf "${HOME}/Library/Caches/CocoaPods"
rm -rf "`pwd`/Pods/"
pod update
@db0company
db0company / topMostViewController.swift
Created January 19, 2015 14:28
Get the top most viewController anywhere in the app (typically from the appDelegate). Get the current visible viewController.
extension UIViewController {
func topMostViewController() -> UIViewController {
if self.presentedViewController == nil {
return self
}
if let navigation = self.presentedViewController as? UINavigationController {
return navigation.visibleViewController.topMostViewController()
}
if let tab = self.presentedViewController as? UITabBarController {
if let selectedTab = tab.selectedViewController {
@khanlou
khanlou / Fonts.swift
Created October 6, 2016 21:10
Print all fonts in Swift 3
UIFont.familyNames.forEach({ familyName in
let fontNames = UIFont.fontNames(forFamilyName: familyName)
print(familyName, fontNames)
})
@cwalo
cwalo / RoundShadowView.swift
Created December 29, 2017 00:10
UIView with cornerRadius and Shadow
/*
Example of how to create a view that has rounded corners and a shadow.
These cannot be on the same layer because setting the corner radius requires masksToBounds = true.
When it's true, the shadow is clipped.
It's possible to add sublayers and set their path with a UIBezierPath(roundedRect...), but this becomes difficult when using AutoLayout.
Instead, we a containerView for the cornerRadius and the current view for the shadow.
All subviews should just be added and constrained to the containerView
*/
import UIKit
@alsedi
alsedi / gist:64954a98bd44d1b5675002b3781f0954
Created April 5, 2018 15:02
UIView+SizeConstraints.Swift
import Foundation
extension UIView {
func height(constant: CGFloat) {
setConstraint(value: constant, attribute: .height)
}
func width(constant: CGFloat) {
setConstraint(value: constant, attribute: .width)
}
@a-v-ershov
a-v-ershov / toxic_comments_example.ipynb
Created May 2, 2021 19:59
An example of data science task
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.