Source: https://wiki.archlinux.org/index.php/PostgreSQL
-
Install postgresql package
sudo pacman -S postgresql -
Switch to the postgres user account and initialize the database cluster:
sudo -iu postgres| /* | |
| * Copyright 2017 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 |
Source: https://wiki.archlinux.org/index.php/PostgreSQL
Install postgresql package
sudo pacman -S postgresql
Switch to the postgres user account and initialize the database cluster:
sudo -iu postgres| fun <T> debounce( | |
| waitMs: Long = 300L, | |
| scope: CoroutineScope, | |
| destinationFunction: (T) -> Unit | |
| ): (T) -> Unit { | |
| var debounceJob: Job? = null | |
| return { param: T -> | |
| debounceJob?.cancel() | |
| debounceJob = scope.launch { | |
| delay(waitMs) |
| public enum MyPermission { | |
| // declare runtime permissions specific to your app here (don't keep unused ones) | |
| READ_PHONE_STATE(Manifest.permission.READ_PHONE_STATE), | |
| FINE_LOCATION(Manifest.permission.ACCESS_FINE_LOCATION); | |
| public static MyPermission fromAndroidPermission(String androidPermission) { | |
| for (MyPermission permission : MyPermission.values()) { | |
| if (permission.getAndroidPermission().equals(androidPermission)) { | |
| return permission; | |
| } |
| type Effector func(context.Context) (string, error) | |
| func Retry(effector Effector, retries int, delay time.Duration) Effector { | |
| return func(ctx context.Context) (string, error) { | |
| for r := 0; ; r++ { | |
| response, err := effector(ctx) | |
| if err == nil || r >= retries { | |
| // Return when there is no error or the maximum amount | |
| // of retries is reached. | |
| return response, err |