This file contains hidden or 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
// | |
// GentleActivityIndicatorView.swift | |
// veladan | |
// | |
// Created by Daniel Vela Angulo on 19/02/2019. | |
// Copyright © 2019 veladan. All rights reserved. | |
// | |
import UIKit |
This file contains hidden or 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
// | |
// SpinnerView.swift | |
// veladan | |
// | |
// Created by Daniel Vela Angulo on 02/04/2019. | |
// Copyright © 2019 veladan. All rights reserved. | |
// | |
import UIKit |
This file contains hidden or 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
// | |
// DownloadImageView.swift | |
// | |
// Created by Daniel Vela on 18/06/2019. | |
// Copyright © 2019 veladan. All rights reserved. | |
// | |
import UIKit | |
/// Use this class to download an image form an url and present it |
This file contains hidden or 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
#!/usr/bin/env ruby | |
# Backup each project by cloning all their repositories: clone the main repo and also the wiki repo. | |
# | |
# git clone [email protected]:ai/AAI.git | |
# | |
# The clone must be done only once. After that use ```git fetch --all``` to refresh all data | |
# | |
# - [doc](https://stackoverflow.com/questions/67699/how-to-clone-all-remote-branches-in-git) | |
# |
This file contains hidden or 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 nltk | |
nltk.download('stopwords') | |
from nltk.corpus import stopwords | |
REPLACE_BY_SPACE_RE = re.compile('[/(){}\[\]\|@,;]') | |
BAD_SYMBOLS_RE = re.compile('[^0-9a-z #+_]') | |
STOPWORDS = set(stopwords.words('english')) | |
def text_prepare(text): | |
""" |
This file contains hidden or 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
// This is the way to create an almost-singleton class and allow replace for testing. | |
// The difference from a real singleton is in the type of property to store the instance: | |
// it's declared 'var' allowing to substitute the instace, instead using a 'let' property | |
// as it would be a real singleton. It works for testing | |
class Singleton { | |
static var shared = { Singleton()}() | |
} | |
// If you don't want to inherit from the Singleton class, |
This file contains hidden or 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
// 1 | |
view.backgroundColor = .clear | |
// 2 | |
let blurEffect = UIBlurEffect(style: .light) | |
// 3 | |
let blurView = UIVisualEffectView(effect: blurEffect) | |
// 4 | |
blurView.translatesAutoresizingMaskIntoConstraints = false | |
view.insertSubview(blurView, at: 0) |
This file contains hidden or 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
final class Manager { | |
static let shared = Manager() | |
private init() { ... } | |
func foo() { ... } | |
} |
This file contains hidden or 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
.DS_Store | |
UserInterfaceState.xcuserstate |
This file contains hidden or 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
extension String { | |
subscript (i: Int) -> Character { | |
return self[index(startIndex, offsetBy: i)] | |
} | |
subscript (bounds: CountableRange<Int>) -> Substring { | |
let start = index(startIndex, offsetBy: bounds.lowerBound) | |
let end = index(startIndex, offsetBy: bounds.upperBound) | |
return self[start ..< end] | |
} | |
subscript (bounds: CountableClosedRange<Int>) -> Substring { |