Skip to content

Instantly share code, notes, and snippets.

View wicaker's full-sized avatar
🎯
Focusing

I Gede Wicaksana wicaker

🎯
Focusing
View GitHub Profile
// Write a function which takes a name, and then 400ms later, returns the string "Hello, " + name
// 1. Promise
// 2. Async/Await
// 3. Callback
// using promise
var sayHelloPromise = function (name) {
return new Promise(
@wicaker
wicaker / file_aws_s3.go
Created September 1, 2019 05:50
File main.go used to create and upload pdf to aws s3
package main
import (
"bytes"
"log"
"net/http"
"strconv"
"text/template"
"time"
@wicaker
wicaker / docker-compose.yml
Created August 31, 2019 16:37
Docker Compose code, used in project "Create PDF File and Upload to AWS S3 With Golang" for build locakstack
version: '2.1'
services:
localstack:
image: localstack/localstack
ports:
- "4567-4597:4567-4597"
- "${PORT_WEB_UI-8090}:${PORT_WEB_UI-8090}"
environment:
- SERVICES=${SERVICES- }
- DEBUG=${DEBUG- }
package main
import (
"encoding/json"
"fmt"
"log"
"os"
"time"
"github.com/aws/aws-sdk-go/aws"
package main
import (
"flag"
"fmt"
"log"
"os"
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/credentials"
package main
import (
"fmt"
"io/ioutil"
"log"
"os"
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/credentials"