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
import java.io.*; | |
import java.util.*; | |
public class Solution { | |
public static void main(String[] args) { | |
/* Enter your code here. Read input from STDIN. Print output to STDOUT. Your class should be named Solution. */ | |
Scanner scanner = new Scanner(System.in); | |
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
import java.util.*; | |
public class Solution { | |
public static void main(String[] args) { | |
/* Enter your code here. Read input from STDIN. Print output to STDOUT. Your class should be named Solution. */ | |
Scanner scanner = new Scanner(System.in); | |
int n = scanner.nextInt(); | |
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
import java.io.*; | |
import java.util.*; | |
public class Solution { | |
public static void main(String[] args) { | |
Scanner scanner = new Scanner(System.in); | |
String namaPembeli = scanner.nextLine(); | |
int angkaUnik = scanner.nextInt(); |
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
server { | |
listen 80; | |
index index.php index.html; | |
error_log /var/log/nginx/error.log; | |
access_log /var/log/nginx/access.log; | |
root /var/www/public; | |
location ~ \.php$ { | |
try_files $uri =404; | |
fastcgi_split_path_info ^(.+\.php)(/.+)$; |
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
import type { HttpContextContract } from '@ioc:Adonis/Core/HttpContext' | |
import AuthException from 'App/Exceptions/AuthException' | |
import dbConfig from 'Config/database' | |
import Env from '@ioc:Adonis/Core/Env' | |
import Database from '@ioc:Adonis/Lucid/Database'; | |
export default class SwitchDatabase { | |
public async handle({ request }: HttpContextContract, next: () => Promise<void>) { | |
const storeCode = request.header('code-store'); |
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
node ace make:module <Namespace> <ModelName> --endpoint <EndpointName> --soft-delete |
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
CREATE USER <username> EITH ENCRYPTED PASSWORD '<password>'; |
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
import type { HttpContextContract } from '@ioc:Adonis/Core/HttpContext' | |
import AuthException from 'App/Exceptions/AuthException' | |
import AccountService from 'App/Services/User/AccountService' | |
export default class Role { | |
service = new AccountService() | |
public async handle({ auth }: HttpContextContract, next: () => Promise<void>, rule) { | |
const roles = rule | |
if (roles.length == 0) { | |
await next() |
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
server { | |
server_name <app-domain>; | |
access_log /var/log/nginx/<app-name>.access.log; | |
error_log /var/log/nginx/<app-name>.error.log; | |
location / { | |
include proxy_params; | |
proxy_pass http://0.0.0.0:<app-port>; | |
proxy_set_header Host $host; | |
proxy_set_header X-Forwared-Proto $scheme; |
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
module.exports = { | |
apps: [{ | |
name: 'app-name', | |
script: 'build/server.js', | |
autorestart: true, | |
watch: false, | |
max_memory_restart: '2G', | |
env_development: { | |
COMMON_VARIABLE: 'true', | |
PORT: 3000, |