Skip to content

Instantly share code, notes, and snippets.

View sseno's full-sized avatar
🐈
Working from anywhere

sseno

🐈
Working from anywhere
  • Privy
  • Yogyakarta, Indonesia
View GitHub Profile
@sseno
sseno / iterm2-solarized.md
Created November 7, 2023 04:54 — forked from kevin-smets/iterm2-solarized.md
iTerm2 + Oh My Zsh + Solarized color scheme + Source Code Pro Powerline + Font Awesome + [Powerlevel10k] - (macOS)

Default

Default

Powerlevel10k

Powerlevel10k

class IntrinsicTableView: UITableView {
override var contentSize:CGSize {
didSet {
self.invalidateIntrinsicContentSize()
}
}
override var intrinsicContentSize: CGSize {
self.layoutIfNeeded()
@sseno
sseno / statusbar-color-change.md
Created April 22, 2020 13:20 — forked from WrathChaos/statusbar-color-change.md
iOS 13 and Below How to change Status Bar Color?
if #available(iOS 13.0, *) {
    let app = UIApplication.shared
    let statusBarHeight: CGFloat = app.statusBarFrame.size.height
    
    let statusbarView = UIView()
    statusbarView.backgroundColor = UIColor.red
    view.addSubview(statusbarView)
  
 statusbarView.translatesAutoresizingMaskIntoConstraints = false
@sseno
sseno / rotatable.swift
Created April 5, 2020 07:01 — forked from ajself/rotatable.swift
Rotate UIViewControllers that conform to a protocol
/*
This is an update to an example found on http://www.jairobjunior.com/blog/2016/03/05/how-to-rotate-only-one-view-controller-to-landscape-in-ios-slash-swift/
The code there works, with some updating to the latest Swift, but the pattern isn't very Swifty. The following is what I found to be more helpful.
*/
/*
First, create a protocol that UIViewController's can conform to.
This is in opposition to using `Selector()` and checking for the presence of an empty function.
*/
@sseno
sseno / Alert.swift
Created March 29, 2020 00:10
Custom Alert Dialog
let paragraphStyle = NSMutableParagraphStyle()
paragraphStyle.lineSpacing = 3
paragraphStyle.alignment = .left
let titleText = NSAttributedString(
string: "Coming Soon",
attributes: [
NSAttributedString.Key.paragraphStyle: paragraphStyle,
NSAttributedString.Key.foregroundColor : UIColor.black,
NSAttributedString.Key.font : R.font.ubuntuMedium(size: 16)!,
]
@sseno
sseno / README.md
Created October 2, 2019 17:53 — forked from lopspower/README.md
Hexadecimal color code for transparency

Hexadecimal color code for transparency

Twitter

How to set transparency with hex value ?

For example, you want to set 40% alpha transparence to #000000 (black color), you need to add 66 like this #66000000.

All hex value from 100% to 0% alpha: