Skip to content

Instantly share code, notes, and snippets.

View durul's full-sized avatar

durul dalkanat durul

View GitHub Profile
@durul
durul / gist:d2f265c7261f481dba41c8a04139ee55
Last active October 1, 2024 21:05
UI Component Comparison: Flutter vs Jetpack Compose
Concept Flutter Jetpack Compose
Vertical Layout Column Column
Horizontal Layout Row Row
Stacking Layout Stack Box
Flexible Space Expanded Spacer
Text Display Text Text
Text Style style: TextStyle style (TextStyle)
Text Color style: TextStyle(color: ...) color
Button ElevatedButton, TextButton Button
@durul
durul / System Design.md
Created July 29, 2024 01:34 — forked from vasanthk/System Design.md
System Design Cheatsheet

System Design Cheatsheet

Picking the right architecture = Picking the right battles + Managing trade-offs

Basic Steps

  1. Clarify and agree on the scope of the system
  • User cases (description of sequences of events that, taken together, lead to a system doing something useful)
    • Who is going to use it?
    • How are they going to use it?
@durul
durul / MultipleTapLabel.swift
Created August 20, 2018 15:53 — forked from hamdan/MultipleTapLabel.swift
Create Multiple Tappable Links in a UILabel
// MARK: Multiple Tappable Links in a UILabel
extension UITapGestureRecognizer {
func didTapAttributedTextInLabel(label: UILabel, inRange targetRange: NSRange) -> Bool {
// Create instances of NSLayoutManager, NSTextContainer and NSTextStorage
let layoutManager = NSLayoutManager()
let textContainer = NSTextContainer(size: CGSize.zero)
let textStorage = NSTextStorage(attributedString: label.attributedText!)
// Configure layoutManager and textStorage
@durul
durul / List out all the subviews.swift
Last active July 7, 2018 18:15
List out all the subviews in a UIViewcontroller
extension UIView {
private var viewInfo: String {
return "\(classForCoder), frame: \(frame))"
}
private func subviews(parentView: UIView, level: Int = 0, printSubviews: Bool = false) -> [UIView] {
var result = [UIView]()
if level == 0 && printSubviews {
result.append(parentView)
@durul
durul / UIAccessorizedTextField.swift
Created April 7, 2018 15:22 — forked from damienlaughton/UIAccessorizedTextField.swift
UIAccessorizedTextField is an iOS friendly alternative to the drop down list
//
// UIAccessorizedTextField.swift
// AccessorizedTextField
//
// Created by Damien Laughton on 28/03/2018.
// 2018 Mobilology Limited. No rights reserved.
//
import Foundation
import UIKit
@durul
durul / Tabbar.Swift
Created March 5, 2018 19:30 — forked from calt/Tabbar.Swift
UITabBar with custom height in Swift
extension UITabBar {
override public func sizeThatFits(size: CGSize) -> CGSize {
super.sizeThatFits(size)
var sizeThatFits = super.sizeThatFits(size)
sizeThatFits.height = 71
return sizeThatFits
}
}
@durul
durul / .gitconfig
Created February 27, 2018 15:27 — forked from orj/.gitconfig
Using p4merge as Git mergetool on Mac OS X.
[merge]
keepBackup = false
tool = custom
[mergetool "custom"]
cmd = /Applications/p4merge.app/Contents/Resources/launchp4merge "$PWD/$BASE" "$PWD/$REMOTE" "$PWD/$LOCAL" "$PWD/$MERGED"
keepTemporaries = false
trustExitCode = false
keepBackup = false
@durul
durul / remove_brew-mongo_osx.sh
Created February 11, 2018 01:16 — forked from katychuang/remove_brew-mongo_osx.sh
remove mongodb that was installed via brew
#!/usr/bin/env sh
# checks to see if running
launchctl list | grep mongo
launchctl unload ~/Library/LaunchAgents/homebrew.mxcl.mongodb.plist
launchctl remove homebrew.mxcl.mongodb
pkill -f mongod
@durul
durul / brew-java-and-jenv.md
Created October 29, 2017 19:05 — forked from tomysmile/brew-java-and-jenv.md
How To Install Java 8 on Mac

Install HomeBrew first

brew update
brew tap caskroom/cask
brew install brew-cask

If you get the error "already installed", follow the instructions to unlink it, then install again:

@durul
durul / Xcode Defaults.md
Last active November 5, 2018 16:12
Xcode Defaults

Xcode Defaults

Command Line

# Enable internal menu
defaults write com.apple.dt.Xcode ShowDVTDebugMenu -bool YES

# Enable project build time