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
module ApplicationHelper | |
def will_paginate(coll_or_options = nil, options = {}) | |
if coll_or_options.is_a? Hash | |
options = coll_or_options | |
coll_or_options = nil | |
end | |
options = options.merge renderer: TailwindUIPaginationRenderer unless options[:renderer] | |
super(*[coll_or_options, options].compact) | |
end | |
end |
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
/** | |
* JSON and JSONB support for github.com/JetBrains/Exposed. | |
* | |
* Tested with | |
* - github.com/pgjdbc/pgjdbc 42.2.x | |
* - github.com/mysql/mysql-connector-j | |
* - github.com/h2database/h2database | |
* | |
* Based on gist.github.com/qoomon/70bbbedc134fd2a149f1f2450667dc9d | |
* Thanks for everyone in github.com/JetBrains/Exposed#127 |
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 org.jetbrains.exposed.sql.Column | |
import org.jetbrains.exposed.sql.ColumnType | |
import org.jetbrains.exposed.sql.CustomStringFunction | |
import org.jetbrains.exposed.sql.EqOp | |
import org.jetbrains.exposed.sql.Expression | |
import org.jetbrains.exposed.sql.ExpressionWithColumnType | |
import org.jetbrains.exposed.sql.Table | |
import org.jetbrains.exposed.sql.statements.api.PreparedStatementApi | |
import org.jetbrains.exposed.sql.statements.jdbc.JdbcPreparedStatementImpl | |
import org.jetbrains.exposed.sql.stringLiteral |
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
// IMPORTANT! READ THIS FIRST | |
// Assisted Injection doesn't work with @HiltViewModel or @ViewModelInject | |
// Read more about the issue here: https://github.com/google/dagger/issues/2287 | |
// | |
// | |
// AssistedInject and Hilt working together in v2.28-alpha times | |
// Example of a ViewModel using AssistedInject injected in a Fragment by Hilt | |
// As AssistedInject isn't part of Dagger yet, we cannot use in | |
// conjuction with @ViewModelInject |
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
# ____ _ _ ____ ___ _ _ | |
# | _ \| | / \ / ___|/ _ \| \ | | | |
# | |_) | | / _ \| | _| | | | \| | | |
# | __/| |___ / ___ \ |_| | |_| | |\ | | |
# |_| |_____/_/ \_\____|\___/|_| \_| | |
# -------------------------------------- | |
from os import listdir as os_listdir, path as os_path | |
# pip install -U scikit-learn | |
from sklearn.feature_extraction.text import TfidfVectorizer |
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
android { | |
signingConfigs { | |
getByName("debug") { | |
keyAlias = "debug" | |
keyPassword = "my debug key password" | |
storeFile = file("/home/miles/keystore.jks") | |
storePassword = "my keystore password" | |
} | |
create("release") { | |
keyAlias = "release" |
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
infix fun <T>Boolean.then(action : () -> T): T? { | |
return if (this) | |
action.invoke() | |
else null | |
} | |
infix fun <T>T?.elze(action: () -> T): T { | |
return if (this == null) | |
action.invoke() |
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
/* | |
* Copyright 2018 Google Inc. | |
* | |
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file | |
* except in compliance with the License. You may obtain a copy of the License at | |
* | |
* http://www.apache.org/licenses/LICENSE-2.0 | |
* | |
* Unless required by applicable law or agreed to in writing, software distributed under the | |
* License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
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
Task | |
Finish the function numberToOrdinal, which should take a number and return it as a string with the correct ordinal indicator suffix (in English). For example, 1 turns into "1st". | |
For the purposes of this challenge, you may assume that the function will always be passed a non-negative integer. If the function is given 0 as an argument, it should return '0' (as a string). | |
To help you get started, here is an excerpt from Wikipedia's page on Ordinal Indicators: | |
st is used with numbers ending in 1 (e.g. 1st, pronounced first) | |
nd is used with numbers ending in 2 (e.g. 92nd, pronounced ninety-second) | |
rd is used with numbers ending in 3 (e.g. 33rd, pronounced thirty-third) |
NewerOlder