Skip to content

Instantly share code, notes, and snippets.

View mrfarukturgut's full-sized avatar

Faruk Turgut mrfarukturgut

  • Apprecode
  • Istanbul
View GitHub Profile
@vinczebalazs
vinczebalazs / SheetModalPresentationController.swift
Last active February 1, 2024 04:40
A presentation controller to use for presenting a view controller modally, which can be dismissed by a pull down gesture. The presented view controller's height is also adjustable.
import UIKit
extension UIView {
var allSubviews: [UIView] {
subviews + subviews.flatMap { $0.allSubviews }
}
func firstSubview<T: UIView>(of type: T.Type) -> T? {
allSubviews.first { $0 is T } as? T
@FradSer
FradSer / iterm2_switch_automatic.md
Last active May 3, 2024 19:58
Switch iTerm2 color preset automatic base on macOS dark mode.

The latest beta (3.5) includes separate color settings for light & dark mode. Toggling dark mode automatically switches colors.

Vist iTerm2 homepage or use brew install iterm2-beta to download the beta. Thanks @stefanwascoding.


  1. Add switch_automatic.py to ~/Library/ApplicationSupport/iTerm2/Scripts/AutoLaunch with:
@GeekTree0101
GeekTree0101 / ChatFlowLayoutExample.swift
Created June 6, 2018 03:14
Texture Chat Application UICollectionView Flow Layout Example
import Foundation
import AsyncDisplayKit
class ChatFlowLayoutExample: UICollectionViewFlowLayout {
private var topVisibleItem = Int.max
private var bottomVisibleItem = -Int.max
private var offset: CGFloat = 0.0
private var visibleAttributes: [UICollectionViewLayoutAttributes]?
private var isPrepend: Bool = false
@antishok
antishok / char-rnn-keras-train.py
Last active December 11, 2017 09:06
keras char-rnn
import sys
import numpy as np
from keras.models import Sequential, load_model
from keras.layers import Dense, Activation, Dropout, LSTM, Embedding, Lambda
from keras import optimizers
from keras import backend as K
from keras.callbacks import ModelCheckpoint
filepath = 'input.txt'
seq_len = 80
@kevin-smets
kevin-smets / iterm2-solarized.md
Last active May 3, 2024 12:59
iTerm2 + Oh My Zsh + Solarized color scheme + Source Code Pro Powerline + Font Awesome + [Powerlevel10k] - (macOS)

Default

Default

Powerlevel10k

Powerlevel10k