Skip to content

Instantly share code, notes, and snippets.

View caongocthai's full-sized avatar

Harry Cao caongocthai

View GitHub Profile
const one = () => Promise.resolve("One!")
var num = 1
async function myFunc() {
console.log('Begin function')
const res = await one()
// Lines from this point onward are suspended because of await
// If we use one().then(res => console.log(res)), [9]console.log("End function") will not be suspended and will executed before [14] console.log("After")
console.log("num = ", num)

Keybase proof

I hereby claim:

  • I am port3000 on github.
  • I am harrycao (https://keybase.io/harrycao) on keybase.
  • I have a public key ASC6czmk8pehxOVyPN3-kQP8hhXDvnzbiLHUOtX6QnVN-Qo

To claim this, I am signing this object:

@caongocthai
caongocthai / Naivebayes.go
Last active April 23, 2022 02:43
Sentiment Analysis: Naive Bayes Classifier from scratch in Golang
package main
// The string values of the 2 classes
// They can be "positive" >< "negative" as in this example
// They can also be "ham" >< "spam", i.e.
const (
positive = "positive"
negative = "negative"
)