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
| <?php | |
| // base url | |
| define("BASE_URL", "http://localhost/kuliahti/"); | |
| // format tanggal indonesia | |
| function tanggal_indonesia($date) | |
| { | |
| $hari = array( | |
| "Minggu", | |
| "Senin", |
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
| <?php | |
| include "../function/connection.php"; | |
| include "../function/helper.php"; | |
| $site_key = '6LfKB2cUAAAAAAoh18m-HBnYmjgwRkWQabNKYeTF'; // Diisi dengan site_key API Google reCapthca yang sobat miliki | |
| $secret_key = '6LfKB2cUAAAAADpVAwNAqpwjOE2o7o6Dj5on4Xvo'; // Diisi dengan secret_key API Google reCapthca yang sobat miliki | |
| $ip = $_SERVER['REMOTE_ADDR']; // get IP user | |
| $artikel_id = $_POST['artikel_id']; |
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
| // Future versions of Hyper may add additional config options, | |
| // which will not automatically be merged into this file. | |
| // See https://hyper.is#cfg for all currently supported options. | |
| module.exports = { | |
| config: { | |
| // choose either `'stable'` for receiving highly polished, | |
| // or `'canary'` for less polished but more frequent updates | |
| updateChannel: 'stable', |
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
| const express = require("express"); | |
| const bodyParser = require("body-parser"); | |
| const mongoose = require("mongoose"); | |
| const ejs = require("ejs"); | |
| const app = express(); | |
| app.set("view engine", "ejs"); | |
| app.use(bodyParser.urlencoded({extended: true})); |
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
| const path = require('path'); | |
| const HtmlWebpackPlugin = require('html-webpack-plugin'); | |
| module.exports = { | |
| // Entry | |
| entry: './src/index.js', | |
| // Output | |
| output: { | |
| path: path.resolve(__dirname, 'dist'), | |
| filename: 'bundle.js', |
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
| 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" ], |
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
| // in models/index.js | |
| if (sequelize) { | |
| sequelize | |
| .authenticate() | |
| .then(() => { | |
| console.log('Connection has been established successfully.'); | |
| }) | |
| .catch((err) => { | |
| console.error('Unable to connect to the database:', err); | |
| }); |
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
| https://speakerdeck.com/rottmann/api-documentation?slide=14 | |
| https://indrakusuma.web.id/2017/11/09/Tutorial-Buat-Dokumentasi-RESTful-API-dengan-APIdocJS/ |
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
| 'use strict'; | |
| module.exports = { | |
| up: async (queryInterface, Sequelize) => { | |
| await queryInterface.createTable('stores', { | |
| id: { | |
| allowNull: false, | |
| autoIncrement: true, | |
| primaryKey: true, | |
| type: Sequelize.INTEGER | |
| }, |
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
| class AppError extends Error { | |
| constructor(message, statusCode) { | |
| super(message); | |
| this.statusCode = statusCode; | |
| this.status = `${statusCode}`.startsWith('4') ? 'fail' : 'error'; | |
| this.isOperational = true; | |
| Error.captureStackTrace(this, this.constructor); | |
| } |
OlderNewer