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
const Lab = require("@hapi/lab"); | |
const { expect } = require("chai"); | |
const sinon = require("sinon"); | |
const nodemailer = require("nodemailer"); | |
const { PASS_MAIL, USER_MAIL } = process.env; | |
const { init } = require("../server_test"); | |
const { | |
describe, it, beforeEach, afterEach, |
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
pipeline { | |
agent any | |
parameters { | |
booleanParam description: 'Is this a production deployment?', name: 'DEPLOY_PROD_PORTAL' | |
} | |
environment { | |
SSH_HOST = '10.2.xx.yyy' | |
SSH_USER = 'yaadmin' |
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
Here's an example of a Node.js script that sets a reminder for a certain date using the node-cron package: | |
// particular date | |
const cron = require('node-cron'); | |
const reminderDate = new Date("2022-12-31 23:59:00"); | |
const schedule = cron.schedule(reminderDate, () => { | |
console.log("Reminder: Do something!"); |
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
stages: | |
- publish | |
- deploy | |
variables: | |
TAG_LATEST: $CI_REGISTRY_IMAGE/$CI_COMMIT_REF_NAME:latest | |
TAG_COMMIT: $CI_REGISTRY_IMAGE/$CI_COMMIT_REF_NAME:$CI_COMMIT_SHORT_SHA | |
DOCKER_HOST: tcp://docker:2375 | |
DOCKER_TLS_CERTDIR: "" | |
DOCKER_DRIVER: overlay2 |
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
function getProducts(url){ | |
const promise = new Promise((resolve,reject) => { | |
const data = getData(url); | |
if(data.isExist()){ | |
resolve(data.to_json()); | |
}else{ | |
reject("error"); | |
} | |
}) |
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
# delta_nom.rb | |
require 'sqlite3' | |
class Measurement | |
def initialize(project) | |
@db_path = "dch-jcodeodor/#{project}/sqlite-jcodeodor/database" | |
end | |
# db_sqlite berisi (before || after) | |
def get_nom(db_sqlite) |
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
// read makeCommandPane.md | |
class ExecuteExternalDialog{ | |
private JPanel makeCommandPane() { | |
JPanel panel = new JPanel(new BorderLayout()); | |
ngapain1(); | |
panel.add(main, BorderLayout.CENTER); | |
bottom = getBottom(); | |
panel.add(bottom, BorderLayout.SOUTH); | |
ngapain2(); |
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
1.8 | |
# catatan | |
# file ini dipindahkan di home directory | |
# jika sudah di home, hapus komentar catatan ini | |
# isi file hanya versi java |
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
import nltk | |
# ubah jadi tipe nltk | |
def convertToText(filename): | |
# raw/str -> token/list -> convert ke nltk.Text | |
raw = open(filename).read() | |
# type(raw) == string | |
tokens = nltk.word_tokenize(raw) | |
# type(tokens) == list | |
# token bisa berupa tanda-baca{?.,etc}, pos = {adverb,adj,} | |
return nltk.Text(tokens) |
NewerOlder