Skip to content

Instantly share code, notes, and snippets.

View diki-haryadi's full-sized avatar
🎯
Focusing

Diki Haryadi diki-haryadi

🎯
Focusing
View GitHub Profile
@diki-haryadi
diki-haryadi / 𝐓𝐢𝐠𝐡𝐭-𝐂𝐨𝐮𝐩𝐥𝐢𝐧𝐠-vs-𝐋𝐨𝐨𝐬𝐞-𝐂𝐨𝐮𝐩𝐥𝐢𝐧𝐠.md
Created December 31, 2024 22:57
Mau liat contoh 𝐓𝐢𝐠𝐡𝐭 𝐂𝐨𝐮𝐩𝐥𝐢𝐧𝐠 vs 𝐋𝐨𝐨𝐬𝐞 𝐂𝐨𝐮𝐩𝐥𝐢𝐧𝐠 pake 𝐆𝐨𝐥𝐚𝐧𝐠?

𝐓𝐢𝐠𝐡𝐭 𝐂𝐨𝐮𝐩𝐥𝐢𝐧𝐠

Di contoh ini, UserService langsung terikat sama DataSource tertentu. Kalo kita mau ganti dari PostgreSQL ke MySQL misalnya, kita harus rombak banyak hal di UserService.

package main

import "fmt"

// DataSource contohnya "koneksi" ke DB tertentu
type DataSource struct {
# create script
nano create-shortcut.sh
```
#!/bin/bash
echo "Enter the path to the logo image:"
read logo_path
echo "Enter the path to the executable application:"
read executable_path
# GS Appscript
```
function doGet(e) {
Logger.log(e);
var op = e.parameter.action;
var ss = SpreadsheetApp.open(DriveApp.getFileById("YOUR_SPREADSHEET_ID"));
var sn = "YOUR_SHEET_NAME";
var sheet = ss.getSheetByName(sn);
package main
import (
"crypto/aes"
"crypto/cipher"
"crypto/rand"
"encoding/hex"
"errors"
"fmt"
"io"
@diki-haryadi
diki-haryadi / Reverse Array
Last active December 18, 2021 03:56
Reverse Array
package main
import (
"bufio"
"fmt"
"io"
"os"
"strconv"
"strings"
)
@diki-haryadi
diki-haryadi / Handling Null SQL in Golang
Created December 15, 2021 10:59
Handling Null SQL in Golang
```
package helper
import (
"database/sql"
"encoding/json"
"fmt"
"reflect"
"time"
@diki-haryadi
diki-haryadi / List Belajar
Created November 29, 2021 15:34
List Belajar
# Resource Belajar
- https://www.golangprograms.com/for-range-loops.html
- https://www.geeksforgeeks.org/fmt-printf-function-in-golang-with-examples/
- https://github.com/rakyll/gowiki/blob/master/GoUsers.md
- http://kokizzu.blogspot.com/2016/12/list-of-tech-migrations.html
- https://go.dev/tour/welcome/1
- https://play-with-go.dev/
- https://gobyexample.com/
- https://www.youtube.com/results?search_query=golang+tutorial&sp=EgIQAw%253D%253D
- https://gist.github.com/prologic/5f6afe9c1b98016ca278f4d507e65510
@diki-haryadi
diki-haryadi / nullHandle.go
Created October 31, 2021 19:56 — forked from rsudip90/nullHandle.go
How I handled the null possible value in a sql database row in golang?
package main
import (
"database/sql"
"encoding/json"
"fmt"
"reflect"
"time"
"github.com/go-sql-driver/mysql"
@diki-haryadi
diki-haryadi / mysql-server.md
Last active September 23, 2021 03:48
Install and Config Mysql on Ubuntu

$ sudo apt install default-mysql-server default-mysql-client

$ sudo cat /etc/mysql/debian.cnf

# Automatically generated for Debian scripts. DO NOT TOUCH!
[client]
host     = localhost
user     = debian-sys-maint
password = JRptVM1k9l8SvIau
socket = /var/run/mysqld/mysqld.sock
@diki-haryadi
diki-haryadi / password-change.md
Created September 20, 2021 08:22
Change Password mysql After installation

$ sudo cat /etc/mysql/debian.cnf

# Automatically generated for Debian scripts. DO NOT TOUCH!
[client]
host     = localhost
user     = debian-sys-maint
password = JRptVM1k9l8SvIau
socket   = /var/run/mysqld/mysqld.sock
[mysql_upgrade]
host = localhost