Skip to content

Instantly share code, notes, and snippets.

View mrfarukturgut's full-sized avatar

Faruk Turgut mrfarukturgut

  • Apprecode
  • Istanbul
View GitHub Profile
import UIKit
extension UITableView {
func scrollToBottom(){
DispatchQueue.main.async {
let indexPath = IndexPath(
row: self.numberOfRows(inSection: self.numberOfSections-1) - 1,
section: self.numberOfSections - 1)
@mrfarukturgut
mrfarukturgut / publisher.swift
Last active February 17, 2021 07:19
Plain publisher
import UIKit
struct Books: Codable {}
struct Movies: Codable {}
// MARK: - Observer
protocol BooksObserver {
import UIKit
import Foundation
enum Endpoint {
case profile
}
protocol Fetchable {
static var endpoint: Endpoint { get }
@mrfarukturgut
mrfarukturgut / GenericDelegation.swift
Last active November 2, 2020 14:55
Generic delegation problem
import UIKit
import Foundation
enum Endpoint {
case profile
}
protocol Fetchable {
static var endpoint: Endpoint { get }
}
<?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>
@mrfarukturgut
mrfarukturgut / .zshrc
Created May 30, 2020 09:33
ZSH Config
# 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"
@mrfarukturgut
mrfarukturgut / .p10k.zsh
Last active October 23, 2021 17:49
P10K Config
# 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.
#
//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,