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 java.io.*; | |
import org.apache.lucene.analysis.*; | |
import org.apache.lucene.util.Version; | |
public class MyAnalyzer extends Analyzer { | |
public TokenStream tokenStream(String fieldName, Reader reader) { | |
return | |
new StopFilter( | |
true, |
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
val scalacOptions ++= Seq( | |
"-encoding", | |
"utf-8", // Specify character encoding used by source files. | |
"-deprecation", // Emit warning and location for usages of deprecated APIs. | |
"-explaintypes", // Explain type errors in more detail. | |
"-feature", // Emit warning and location for usages of features that should be imported explicitly. | |
"-language:existentials", // Existential types (besides wildcard types) can be written and inferred | |
"-language:experimental.macros", // Allow macro definition (besides implementation and application) | |
"-language:higherKinds", // Allow higher-kinded types | |
"-language:implicitConversions", // Allow definition of implicit functions called views |
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
scalacOptions ++= Seq( | |
"-deprecation", // Emit warning and location for usages of deprecated APIs. | |
"-encoding", "utf-8", // Specify character encoding used by source files. | |
"-explaintypes", // Explain type errors in more detail. | |
"-feature", // Emit warning and location for usages of features that should be imported explicitly. | |
"-language:existentials", // Existential types (besides wildcard types) can be written and inferred | |
// "-language:experimental.macros", // Allow macro definition (besides implementation and application). Disabled, as this will significantly change in Scala 3 | |
"-language:higherKinds", // Allow higher-kinded types | |
// "-language:implicitConversions", // Allow definition of implicit functions called views. Disabled, as it might be dropped in Scala 3. Instead use extension methods (implemented as implicit class Wrapper(va |
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
val scalacOptions = Seq( | |
"-encoding", | |
"utf-8", // Specify character encoding used by source files. | |
"-Ybackend-parallelism", // | |
"8", | |
"-explaintypes", // Explain type errors in more detail. | |
"-feature", // Emit warning and location for usages of features that should be imported explicitly. | |
"-unchecked", // Enable additional warnings where generated code depends on assumptions. | |
"-Xcheckinit", // Wrap field accessors to throw an exception on uninitialized access. | |
// "-Ymacro-annotations", // Enable support for macro annotations, formerly in macro paradise. |
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
#!/bin/sh | |
# Должны быть установлены: | |
# brew (установить можно через скрипт /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)") | |
# brew install openconnect | |
# brew install oath-toolkit | |
# сохранить скрипт в файл vpn.sh | |
# перед запуском делаем chmod +x vpn.sh | |
# запускаем sudo vpn.sh |
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
-- Get Max ID from table | |
SELECT MAX(id) FROM table; | |
-- Get Next ID from table | |
SELECT nextval('table_id_seq'); | |
-- Set Next ID Value to MAX ID | |
SELECT setval('table_id_seq', (SELECT MAX(id) FROM table)); |
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
class GoodsListViewController: UIViewController { | |
struct ViewModel { | |
struct Goods {} | |
let prev: [Goods] | |
let current: Goods | |
let next: [Goods] | |
} | |
private var items: [ViewModel.Goods] = [] | |
private let tableView: UITableView = UITableView(frame: .zero, style: .grouped) |
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
class GoodsListViewController: UIViewController { | |
struct Goods {} | |
private var items: [Goods] = [] | |
private let tableView: UITableView = UITableView(frame: .zero, style: .grouped) | |
func update(goods: [Goods]) { | |
items = goods | |
tableView.reloadData() | |
} |
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
class LoginViewController: UIViewController { | |
struct ViewModel { | |
enum Status { | |
case inProgress | |
case failed(String, login: Command) | |
case login(Command) | |
} | |
let email: String | |
let password: String | |
let status: Status |
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
class LoginViewController: UIViewController { | |
struct ViewModel { | |
let email: String | |
let password: String | |
let error: String | |
let isLoading: Bool | |
let login: () -> Void | |
} | |
private let activityIndicator = UIActivityIndicatorView() |