This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | |
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.
- Add
switch_automatic.py
to~/Library/ApplicationSupport/iTerm2/Scripts/AutoLaunch
with:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |