Skip to content

Instantly share code, notes, and snippets.

View darmawan01's full-sized avatar
🏠
Working from home

Dz darmawan01

🏠
Working from home
  • Indonesia
View GitHub Profile
@darmawan01
darmawan01 / launch.json
Created April 30, 2021 03:03
Launch multiple devices on android debugging
{
"version": "0.2.0",
"configurations": [
{
"name": "appname",
"request": "launch",
"type": "dart"
},
{
"name": "Android",
@darmawan01
darmawan01 / launch.json
Created April 30, 2021 03:02
Launch multi devices on mobile debugging
{
// 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",
@darmawan01
darmawan01 / Proto.MD
Created February 15, 2021 07:09
Proto notes

Generate From Proto

docker run -v pwd:/gen -v pwd/api:/api grpc/go protoc -I /api/ /api/gerbang.proto --go_out=plugins=grpc:/gen

@darmawan01
darmawan01 / err.MD
Created October 1, 2020 03:51
Error creating overlay mount to /var/lib/docker/overlay2

Error:

Error creating overlay mount to /var/lib/docker/overlay2/9ed4841a2d4212795c1cce322e90a058a38602aabe498d944e31f7b902c31313/merged: invalid argument

fix wrong driver

echo '{ "storage-driver": "devicemapper" }' | sudo tee /etc/docker/daemon.json

@darmawan01
darmawan01 / hmm.dart
Last active September 28, 2020 05:50
Check the top of page with scroll controller
```
if (_scrollController.offset <=
_scrollController.position.minScrollExtent &&
!_scrollController.position.outOfRange) {
# Code here
}
```
@darmawan01
darmawan01 / README.md
Created May 18, 2020 15:09
Mysql Command

Backup:

mysqldump --column-statistics=0 --set-gtid-purged=OFF -h<Host> -u<User> -p<Password> <db_name> > backup.sql

Restore:

mysql -u<User> -p<Password> <dest_db> < backup.sql
@darmawan01
darmawan01 / postgres.go
Last active May 16, 2020 14:41
Setup postgres For Go
package db
import "github.com/jackc/pgx"
// InitPostgres func
func InitPostgres() (dbConnPool *pgx.ConnPool) {
conf := getConfig()
var err error
pgxConf := &pgx.ConnConfig{
@darmawan01
darmawan01 / postgres-gorm.go
Created May 16, 2020 14:09
Setup Postgres With Gorm
package db
import (
"fmt"
"github.com/jinzhu/gorm"
_ "github.com/jinzhu/gorm/dialects/postgres"
)
// InitPostgres func
@darmawan01
darmawan01 / mysql-gorm.go
Last active May 16, 2020 14:10
Setup Mysql Connection With Gorm
package db
import (
"fmt"
"github.com/jinzhu/gorm"
_ "github.com/jinzhu/gorm/dialects/mysql"
)
// InitMysql func
@darmawan01
darmawan01 / timezone.MD
Created May 11, 2020 09:27
Change Container Time Zone

None-alpine:

echo <TIMEZONE> > /etc/timezone && ln -sf /usr/share/zoneinfo/<TIMEZONE> /etc/localtime && dpkg-reconfigure -f noninteractive tzdata
// Before
Current default time zone: 'Etc/UTC'
Local time is now: Mon May 11 08:21:58 UTC 2020.