Skip to content

Instantly share code, notes, and snippets.

@birowo
birowo / tetris.md
Last active August 17, 2020 02:35
tetris

tetris

tetris

@birowo
birowo / gnet.go
Created May 16, 2020 04:58
desc.
// Copyright 2019 Andy Pan. All rights reserved.
// Copyright 2017 Joshua J Baker. All rights reserved.
// Use of this source code is governed by an MIT-style
// license that can be found in the LICENSE file.
package main
import (
"flag"
"fmt"
@birowo
birowo / cobaJWT.go
Last active January 25, 2019 13:59
golang: latihan json-web-token(JWT) dengan pakai library: https://github.com/dgrijalva/jwt-go
package main
import (
"errors"
"fmt"
"time"
jwt "github.com/dgrijalva/jwt-go"
)
@birowo
birowo / cobaCaptcha.go
Last active December 17, 2018 08:00
GOLANG: latihan captcha pakai library https://github.com/mojocn/base64Captcha
package main
import (
"net/http"
"github.com/julienschmidt/httprouter"
"github.com/mojocn/base64Captcha"
)
func main() {
@birowo
birowo / menangkap_post_data_json_pakai_gin.go
Last active December 13, 2018 04:32
golang: contoh skrip untuk menangkap post data json pakai gin
package main
import (
"fmt"
"github.com/gin-gonic/gin"
)
type Struct struct {
/* setiap pakai json, huruf pertama dari field struct harus kapital,
package main
import (
"encoding/json"
"math"
"net/http"
"net/url"
"strconv"
"strings"
@birowo
birowo / routerLikeGraphQL.go
Last active November 12, 2018 02:03
GOLANG. coba aplikasi yang menggunakan http router dibuat seperti(meski tidak secanggih) graphql . di sini saya buat untuk method GET request saja.
package main
import (
"encoding/json"
"math"
"net/http"
"net/url"
"strconv"
"strings"
@birowo
birowo / cobaGraphQL.go
Last active October 31, 2018 09:00
contoh implementasi custom scalar di https://github.com/graph-gophers/graphql-go . menambahkan/modifikasi pada latihan graphql terdahulu: https://gist.github.com/birowo/01be2785bdd3b8a875ac1803be79888f
package main
import (
"encoding/json"
"net/http"
"sync"
"github.com/graph-gophers/graphql-go"
)
@birowo
birowo / cobaGraphQL.go
Last active October 26, 2018 10:29
latihan graphql dengan library: https://github.com/graph-gophers/graphql-go yang dikatakan lebih mudah dibanding library lainnya: https://medium.com/open-graphql/choosing-a-graphql-server-library-in-go-8836f893881b
package main
import (
"encoding/json"
"net/http"
"sync"
"github.com/graph-gophers/graphql-go"
)
@birowo
birowo / graphql-go-mongodb-example.go
Created October 24, 2018 02:17 — forked from trunet/graphql-go-mongodb-example.go
Minimal example of GraphQL Golang and MongoDB playing nicely together. Edit
// Embedded in this article https://medium.com/p/c98e491015b6
package main
import (
"context"
"fmt"
"log"
"net/http"
"time"