Skip to content

Instantly share code, notes, and snippets.

Avatar

Faruk Turgut mrfarukturgut

  • Istanbul
View GitHub Profile
View ScrollToBottomTest.swift
import UIKit
extension UITableView {
func scrollToBottom(){
DispatchQueue.main.async {
let indexPath = IndexPath(
row: self.numberOfRows(inSection: self.numberOfSections-1) - 1,
section: self.numberOfSections - 1)
View publisher.swift
import UIKit
struct Books: Codable {}
struct Movies: Codable {}
// MARK: - Observer
protocol BooksObserver {
View gist:e4f738e1f6462a3b5b47ae81d4575b29
import UIKit
import Foundation
enum Endpoint {
case profile
}
protocol Fetchable {
static var endpoint: Endpoint { get }
@mrfarukturgut
mrfarukturgut / GenericDelegation.swift
Last active Nov 2, 2020
Generic delegation problem
View GenericDelegation.swift
import UIKit
import Foundation
enum Endpoint {
case profile
}
protocol Fetchable {
static var endpoint: Endpoint { get }
}
View xcode.itermcolors
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Ansi 0 Color</key>
<dict>
<key>Alpha Component</key>
<real>1</real>
<key>Blue Component</key>
<real>0.35686275362968445</real>
View .zshrc
# export PATH=$HOME/bin:/usr/local/bin:$PATH
# Path to your oh-my-zsh installation.
export ZSH="/Users/faruk/.oh-my-zsh"
# export PATH="/Users/faruk/anaconda3/bin:$PATH" # commented out by conda initialize
# Set name of the theme to load --- if set to "random", it will
# load a random theme each time oh-my-zsh is loaded, in which case,
# to know which specific one was loaded, run: echo $RANDOM_THEME
# See https://github.com/robbyrussell/oh-my-zsh/wiki/Themes
ZSH_THEME="powerlevel10k/powerlevel10k"
View .p10k.zsh
# Generated by Powerlevel10k configuration wizard on 2019-10-28 at 16:39 +03.
# Based on romkatv/powerlevel10k/config/p10k-rainbow.zsh, checksum 54930.
# Wizard options: nerdfont-complete + powerline, small icons, rainbow,
# angled separators, sharp heads, flat tails, 2 lines, disconnected, no frame, sparse,
# many icons, fluent.
# Type `p10k configure` to generate another config.
#
# Config for Powerlevel10k with powerline prompt style with colorful background.
# Type `p10k configure` to generate your own config based on it.
#
View View+Extension.swift
//Original code from https://github.com/SwiftUIX/SwiftUIX by @vmanot
import Foundation
import SwiftUI
import UIKit
extension View {
@inlinable
public func navigationBarItems<Leading: View, Center: View, Trailing: View>(
leading: Leading,