- assignments (penugasan pengguna)
- categories (kategori pertanyaan)
- organizations (unit)
- packages (paket soal)
- program (program ujian)
- questions (bank soal)
- schedules (jadwal ujian + paket soal setiap peserta)
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 signer = require('node-signpdf').default | |
const fs = require('fs') | |
const { plainAddPlaceholder } = require('node-signpdf/dist/helpers'); | |
const pdfSignedPath = `./signed.pdf`; | |
const pdfBuffer = fs.readFileSync(`./source.pdf`); | |
const certBuffer = fs.readFileSync(`./certificate.p12`); | |
let inputBuffer = plainAddPlaceholder({ | |
pdfBuffer, |
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 toInt = (string) => parseInt(string) || 0 | |
console.log( | |
toInt(null), // 0 | |
toInt(undefined), // 0 | |
toInt(NaN), // 0 | |
toInt(""), // 0 | |
toInt({}), // 0 | |
toInt(0), // 0 | |
toInt([]), // 0 |
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 React from 'react' | |
import { useHistory, useParams } from 'react-router-dom' | |
import Axios from 'axios' | |
const getProduct = async (productId, callback) => { | |
try { | |
const response = await Axios.get(`http://localhost:3000/product/${productId}`) | |
console.log(response) | |
callback(response.data) | |
} catch (error) { |
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 methodOverride = require('method-override') | |
const app = express() | |
app.use(bodyParser.urlencoded({ limit: '50mb', extended: true })) | |
app.use(bodyParser.json({limit: '50mb'})) | |
app.use(methodOverride()) | |
app.use((err, req, res, 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
find . \( -iname "*.jpg" -o -iname "*.png" \) -print0 | \ | |
while read -d $'\0' -r image; do | |
convert $image -resize '500>' $image; | |
read w h < <(sips -g pixelWidth -g pixelHeight "$image" | \ | |
awk '/Width:/{w=$2} /Height:/{h=$2} END{print w " " h}') | |
echo $image $w $h | |
done |
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 React from 'react' | |
const getUsers = async (callback) => { | |
// call api | |
// dummy response | |
const response = { | |
status: 'success', | |
message: 'get data user success', | |
data: [ | |
{id: 1, name: 'AAA'}, |
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 Check { | |
constructor(value) { | |
this.value = value | |
this.result = false | |
} | |
match(pattern) { | |
const patterns = { | |
alpha: /^[a-z\s]+$/i, | |
alnum: /^[a-z0-9\s]+$/i, |
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
-- phpMyAdmin SQL Dump | |
-- version 4.7.7 | |
-- https://www.phpmyadmin.net/ | |
-- | |
-- Host: mysql | |
-- Generation Time: Jul 26, 2018 at 07:44 AM | |
-- Server version: 5.7.21 | |
-- PHP Version: 7.1.9 | |
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; |
NewerOlder