Skip to content

Instantly share code, notes, and snippets.

@ismiyati
ismiyati / latSQL.go
Last active February 3, 2019 09:50
#GO . latihan sql dengan kolom-kolom baru ditentukan saat runtime sehingga hasilnya slice of map dan bukan seperti umumnya slice of struct
package main
import (
"database/sql"
"fmt"
_ "github.com/go-sql-driver/mysql"
)
func main() {
@ismiyati
ismiyati / mysqlOneToMany.go
Last active February 15, 2019 22:49
#GO . latihan mysql one to many relation
package main
import (
"database/sql"
"encoding/json"
"fmt"
_ "github.com/go-sql-driver/mysql"
)
@ismiyati
ismiyati / cobaMySQLStorProc.go
Last active March 6, 2019 09:48
coba mysql (mariadb) stored procedure sederhana
package main
import (
"database/sql"
"fmt"
_ "github.com/go-sql-driver/mysql"
)
func main() {
@ismiyati
ismiyati / cobaPgSQLCreaFunc.go
Last active March 6, 2019 09:33
coba postgre SQL , create function
package main
import (
"database/sql"
"fmt"
_ "github.com/lib/pq"
)
func main() {
@ismiyati
ismiyati / cobaPgStorProc.go
Last active March 7, 2019 01:05
coba postgre SQL stored procedure
package main
import (
"database/sql"
"fmt"
_ "github.com/lib/pq"
)
func main() {
@ismiyati
ismiyati / cobaChacha20.g0
Last active March 15, 2019 23:11
generate random values using chacha20. untuk setiap nilai seek yang sama menghasilkan deret random yang sama. hasil seperti di screenshot
package main
import (
"bytes"
"fmt"
"github.com/Yawning/chacha20"
)
func main() {
@ismiyati
ismiyati / cobaHTTP2Brotli.go
Last active March 16, 2019 23:59
coba brotli diakses pakai http2 . prerequisite: install https://github.com/google/brotli untuk kompresi , ini skrip c ; install https://github.com/itchio/go-brotli untuk binding ke c & install https://github.com/jomoespe/http2-push untuk mencoba , yang file main.go -nya dimodif sbb.:
/* modif dari skrip https://github.com/jomoespe/http2-push/blob/master/main.go */
/* akses https://localhost:8443 di browser ditandai not secure karena self signed certificate */
package main
import (
"fmt"
"io"
"net/http"
"time"
@ismiyati
ismiyati / cobaGin.go
Last active March 18, 2019 07:28
problem di skrip: responseData di- escape sehingga harus di- unescape / unquote
package main
import (
"encoding/json"
"fmt"
"io/ioutil"
"log"
"net/http"
"os"
@ismiyati
ismiyati / gist:7a049b3d79ee5258cac1ca6aa4fa68ce
Created March 20, 2019 09:34 — forked from jwebcat/gist:5122366
Properly download from github using wget and curl
wget --no-check-certificate --content-disposition https://github.com/joyent/node/tarball/v0.7.1
# --no-check-cerftificate was necessary for me to have wget not puke about https
curl -LJO https://github.com/joyent/node/tarball/v0.7.1
package main
import (
"fmt"
"net"
"net/http"
"sync"
"github.com/gobwas/ws"
"github.com/gobwas/ws/wsutil"