This file contains 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'); |
This file contains 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 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 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 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
#Database Configuration | |
spring.datasource.url=jdbc:mariadb://localhost:3306/billboard | |
spring.datasource.username=root | |
spring.datasource.password= | |
spring.datasource.driver-class-name=org.mariadb.jdbc.Driver | |
#Hibernate Configuration | |
# Show or not log for each sql query | |
spring.jpa.show-sql=true |
This file contains 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
version: "3" | |
networks: | |
kong-net: | |
driver: bridge | |
services: | |
####################################### | |
# Postgres: The database used by Kong |
This file contains 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
{ | |
"U2": "easyjet", | |
"1T": "Bulgarian Air Charter", | |
"Q5": "40-Mile Air", | |
"4O": "Interjet", | |
"7A": "Express Air Cargo", | |
"JY": "Air Turks and Caicos", | |
"JU": "Air Serbia", | |
"QH": "Kyrgyzstan", | |
"A8": "Benin Golf Air", |
This file contains 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/bash | |
# source: https://gist.github.com/francoisromain/58cabf43c2977e48ef0804848dee46c3 | |
# and another script to delete the directories created by this script | |
# project-delete.sh: https://gist.github.com/francoisromain/e28069c18ebe8f3244f8e4bf2af6b2cb | |
# Call this file with `bash ./project-create.sh project-name` | |
# - project-name is mandatory | |
# This will creates 4 directories and a git `post-receive` hook. |
This file contains 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
var express = require('express'); | |
var cookieParser = require('cookie-parser'); | |
var session = require('express-session'); | |
var flash = require('express-flash'); | |
var handlebars = require('express-handlebars') | |
var app = express(); | |
var sessionStore = new session.MemoryStore; | |
// View Engines |
This file contains 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
var mediaJSON = { "categories" : [ { "name" : "Movies", | |
"videos" : [ | |
{ "description" : "Big Buck Bunny tells the story of a giant rabbit with a heart bigger than himself. When one sunny day three rodents rudely harass him, something snaps... and the rabbit ain't no bunny anymore! In the typical cartoon tradition he prepares the nasty rodents a comical revenge.\n\nLicensed under the Creative Commons Attribution license\nhttp://www.bigbuckbunny.org", | |
"sources" : [ "http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4" ], | |
"subtitle" : "By Blender Foundation", | |
"thumb" : "images/BigBuckBunny.jpg", | |
"title" : "Big Buck Bunny" | |
}, | |
{ "description" : "The first Blender Open Movie from 2006", | |
"sources" : [ "http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/ElephantsDream.mp4" ], |
NewerOlder