This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // | |
| // Javascript Format NPWP | |
| // | |
| function formatNpwp(value) { | |
| if (typeof value === 'string') { | |
| return value.replace(/(\d{2})(\d{3})(\d{3})(\d{1})(\d{3})(\d{3})/, '$1.$2.$3.$4-$5.$6'); | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require('dotenv/config') | |
| const express = require('express') | |
| const multer = require('multer') | |
| const AWS = require('aws-sdk') | |
| const uuid = require('uuid/v4') | |
| const app = express() | |
| const port = 3000 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/sh | |
| ## install nodejs on your EC2 instance | |
| sudo apt-get update | |
| curl -sL https://deb.nodesource.com/setup_8.x -o nodesource_setup.sh | |
| sudo bash nodesource_setup.sh | |
| sudo apt install -y nodejs | |
| ## verify installation by checking nodejs & npm versions | |
| nodejs -v |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // YouTube API video uploader using JavaScript/Node.js | |
| // You can find the full visual guide at: https://www.youtube.com/watch?v=gncPwSEzq1s | |
| // You can find the brief written guide at: https://quanticdev.com/articles/automating-my-youtube-uploads-using-nodejs | |
| // | |
| // Upload code is adapted from: https://developers.google.com/youtube/v3/quickstart/nodejs | |
| const fs = require('fs'); | |
| const readline = require('readline'); | |
| const assert = require('assert') | |
| const {google} = require('googleapis'); |
OlderNewer