sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list'
wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
sudo apt-get install postgresql-13 postgresql-13-postgis-3
sudo openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout server.key -out server.crt
f, err := ioutil.TempFile("", uuid+".*.pdf")
if err != nil {
log.Print("ioutil.TempFile(): ", err)
return
}
// Write the body to file
if _, err = io.Copy(f, buffReader); err != nil {
log.Print("io.Copy(): ", err)
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
-- turn off paging (less/more) | |
psql> \pset pager off | |
/* | |
Pager usage is off. | |
*/ | |
-- find an object name by id | |
SELECT OID, relname |
SCP Over :
scp "ProxyCommand ssh <jumphost> -W %h:%p" <src> <dest>
RSYNC Over :
rsync -azv -P -e 'ssh -o "ProxyCommand ssh -A <jumphost> -W %h:%p"' <src> <dest>
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 'package:intl/intl.dart'; | |
/// An utility calss that manages specific formats. | |
class DateFormats { | |
/// The [DateFormat] 'yyyy-MM-dd HH:mm:ss'. | |
static final fullDateFormat = new DateFormat('yyyy-MM-dd HH:mm:ss'); | |
/// The [DateFormat] 'yyyy/MM/dd'. | |
static final onlyDayDateFormat = new DateFormat('yyyy/MM/dd'); |
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 'dart:ui'; | |
import 'package:flutter/cupertino.dart'; | |
import 'package:flutter/foundation.dart'; | |
class CacheMemoryImageProvider extends ImageProvider<CacheMemoryImageProvider> { | |
final String tag; //the cache id use to get cache | |
final Uint8List img; //the bytes of image to cache | |
CacheMemoryImageProvider(this.tag, this.img); |
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
{ | |
"version": "0.2.0", | |
"configurations": [ | |
{ | |
"name": "appname", | |
"request": "launch", | |
"type": "dart" | |
}, | |
{ | |
"name": "Android", |
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
{ | |
// Use IntelliSense to learn about possible attributes. | |
// Hover to view descriptions of existing attributes. | |
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 | |
// Use `flutter devices` to get your devices id | |
"version": "0.2.0", | |
"configurations": [ | |
{ | |
"name": "appname", |