Sending Emails with Node.js Using SMTP, Gmail, and OAuth2 code example

Example 1: how to build jquery messages notification with php and mysq

<script type="text/javascript">

$(document).ready(function(){
$("#datacount").load("select.php");
setInterval(function(){
$("#datacount").load('select.php')
}, 20000);
 });

</script>

Example 2: How to send JSON Web Token (JWT Token) as header with Postman and golang

func CreateTokenEndpoint(w http.ResponseWriter, req *http.Request) {
    var user User
    _ = json.NewDecoder(req.Body).Decode(&user)
    token := jwt.NewWithClaims(jwt.SigningMethodHS256, jwt.MapClaims{
        "username": user.Username,
    })
    tokenString, error := token.SignedString([]byte("secret"))
    if error != nil {
        fmt.Println(error)
    }
    json.NewEncoder(w).Encode(JwtToken{Token: tokenString})
}

Tags:

Misc Example