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
<?xml version="1.0" encoding="UTF-8"?> | |
<configuration> | |
<include resource="org/springframework/boot/logging/logback/defaults.xml"/> | |
<include resource="org/springframework/boot/logging/logback/console-appender.xml"/> | |
<appender name="CLOUD_WATCH_FRIENDLY" class="ch.qos.logback.core.ConsoleAppender"> | |
<encoder> | |
<pattern>%clr(%d{${LOG_DATEFORMAT_PATTERN:-yyyy-MM-dd HH:mm:ss.SSS}}){faint} %clr(${LOG_LEVEL_PATTERN:-%5p}) %clr(${PID:- }){magenta} %clr(---){faint} %clr([%15.15t]){faint} %clr(%-40.40logger{39}){cyan} %clr(:){faint} %m %replace(%rEx{short}){'[\r\n\t]+', '\\n'}%nopex%n</pattern> | |
</encoder> |
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 javax.validation.Constraint; | |
import javax.validation.Payload; | |
import java.lang.annotation.*; | |
@Documented | |
@Constraint(validatedBy = ExampleConstraintValidator.class) | |
@Target({ElementType.FIELD}) | |
@Retention(RetentionPolicy.RUNTIME) | |
public @interface ExampleConstraint { |
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.springframework.data.domain.Page; | |
import org.springframework.data.support.PageableExecutionUtils; | |
import java.util.function.Function; | |
import java.util.stream.Collectors; | |
public final class SpringDataPageUtils { | |
public static <T, C> Page<C> convertPage(Page<T> page, Function<T, C> converter) { | |
return PageableExecutionUtils.getPage( |
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
package ...; | |
import ...JsonUtils; | |
import lombok.extern.slf4j.Slf4j; | |
import org.apache.commons.io.IOUtils; | |
import org.springframework.http.HttpHeaders; | |
import org.springframework.util.LinkedMultiValueMap; | |
import org.springframework.util.MultiValueMap; | |
import org.springframework.web.util.ContentCachingRequestWrapper; | |
import org.springframework.web.util.WebUtils; |
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.apache.commons.lang3.ArrayUtils; | |
import org.junit.After; | |
import org.junit.runner.RunWith; | |
import org.mockito.InOrder; | |
import org.mockito.junit.MockitoJUnitRunner; | |
import static org.mockito.Mockito.inOrder; | |
import static org.mockito.Mockito.verifyNoMoreInteractions; | |
@RunWith(MockitoJUnitRunner.class) |
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
-- Before importing, you need to create table | |
CREATE TABLE example_table | |
( | |
... | |
); | |
-- Importing... | |
COPY example_table | |
FROM 's3://<BUCKET_NAME>/.../example_table.csv' | |
CREDENTIALS 'aws_access_key_id=...;aws_secret_access_key=...' |
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
echo "$(TZ='Europe/Moscow' date +%Y-%m-%d\ %H\:%M)" | |
# output => 2019-01-31 16:52 |
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
#!/bin/bash | |
export AWS_ACCESS_KEY_ID=... | |
export AWS_SECRET_ACCESS_KEY=... | |
export AWS_DEFAULT_REGION=... | |
PG_HOST=... | |
PG_USER=... | |
PG_PASS='...' | |
PG_DB=... |
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
BEGIN; | |
LOCK TABLE ... IN SHARE MODE; | |
SET LOCAL WORK_MEM = '256MB'; | |
ALTER TABLE ...; | |
COMMIT; |
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
public final class TurkishNumberUtils { | |
private static final String SPACE = " "; | |
private static final String EMPTY = ""; | |
private static final String[] PERIOD_NAMES = {EMPTY, "bin", "milyon", "milyar", "trilyon", "katrilyon", "kentilyon"}; | |
private static final String[] UNITS_TEXTS = {EMPTY, "bir", "iki", "üç", "dört", "beş", "altı", "yedi", "sekiz", "dokuz"}; |