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
| BEGIN; | |
| LOCK TABLE ... IN SHARE MODE; | |
| SET LOCAL WORK_MEM = '256MB'; | |
| ALTER TABLE ...; | |
| COMMIT; |
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
| 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"}; |
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
| CREATE EXTENSION pgcrypto; | |
| -- Examples | |
| SELECT ENCODE(DIGEST('password', 'md5'), 'hex'); | |
| SELECT ENCODE(DIGEST('password', 'sha1'), 'hex'); | |
| SELECT ENCODE(DIGEST('password', 'sha224'), 'hex'); | |
| SELECT ENCODE(DIGEST('password', 'sha256'), 'hex'); | |
| SELECT ENCODE(DIGEST('password', 'sha384'), 'hex'); | |
| SELECT ENCODE(DIGEST('password', 'sha512'), 'base64'); |
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
| # export | |
| PGPASSWORD="<PASSWORD>" pg_dump -U <USERNAME> -h <HOST> -d <DB_NAME> -n <SCHEMA_NAME> > export.sql | |
| # import | |
| PGPASSWORD="<PASSWORD>" psql -U <USERNAME> -h <HOST> -d <DB_NAME> -n <SCHEMA_NAME> -f export.sql |
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 org.apache.commons.collections4.CollectionUtils; | |
| import org.apache.commons.collections4.IteratorUtils; | |
| import org.apache.commons.lang3.StringUtils; | |
| import org.hibernate.query.criteria.internal.path.PluralAttributePath; | |
| import org.springframework.data.domain.Page; | |
| import org.springframework.data.domain.PageRequest; | |
| import org.springframework.data.repository.support.PageableExecutionUtils; | |
| import javax.persistence.EntityManager; | |
| import javax.persistence.TypedQuery; |
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/bash | |
| # DESCRIPTION | |
| # ----------- | |
| # | |
| # Produces CSV output like this: | |
| # | |
| # LAST CHANGE TIME, TIME ELAPSED, AUTHOR, BRANCH | |
| # 2017-01-16 14:56:26 +0000, 3 months ago, john.doe@example.com, origin/bug-fix-1 | |
| # 2017-01-23 18:27:53 +0300, 2 months ago, john.doe@example.com, origin/new-feature-1 |
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 org.apache.commons.lang3.ArrayUtils; | |
| import org.junit.After; | |
| import org.junit.runner.RunWith; | |
| import org.mockito.InOrder; | |
| import org.mockito.runners.MockitoJUnitRunner; | |
| import static org.mockito.Mockito.inOrder; | |
| import static org.mockito.Mockito.verifyNoMoreInteractions; | |
| @RunWith(MockitoJUnitRunner.class) |

