Skip to content

Instantly share code, notes, and snippets.

View klogic's full-sized avatar
☀️
Make today better than yesterday.

Narongsak Keawmanee klogic

☀️
Make today better than yesterday.
View GitHub Profile

Docker daemon runs in a separate VM, so in order to clear logs you should do the following steps:

First, you can find the log path inside the VM, with:

docker inspect --format='{{.LogPath}}' NAME|ID

You can connect to the VM with screen

Docker daemon runs in a separate VM, so in order to clear logs you should do the following steps:

First, you can find the log path inside the VM, with:

docker inspect --format='{{.LogPath}}' NAME|ID

You can connect to the VM with screen

Orders
.find()
.sort('-order_id')
.then((result) => {
// ...
})
Orders
.find()
.sort('-order_id')
.lean()
.then((result) => {
// ...
})
let promises = []
promises.push(
Orders
.find()
.sort('-create')
.lean()
.then((result) => {
return result;
})
);
let promises = []
promises.push(
Orders
.find()
.sort('-create')
.lean()
.then((result) => {
return result;
})
);
const puppeteer = require('puppeteer');
(async () => {
const browser = await puppeteer.launch({headless: false}); // headless false will open chrome.
const page = await browser.newPage();
await page.goto('https://www.google.com');
await page.screenshot({path: 'example.png'});
await browser.close();
})();
(async () => {
const browser = await puppeteer.launch({headless: false});
const page = await browser.newPage();
await page.setViewport({ width: 1200, height: 926 });
await page.goto('https://www.youtube.com');
await page
.waitForSelector('#search')
.then((selector)=> selector.type('cat vs cucumber'))
.then(()=> page.click('#search-icon-legacy'));
await page.waitFor(1000);
const cron = require('node-cron');
cron.schedule('0 59 23 * * *', async function (){
let today = new Date();
let dd = today.getDate();
let mm = today.getMonth()+1;
let yyyy = today.getFullYear();
todaydate = `${dd}_${mm}_${yyyy}`;
filename = `geckoboard_${todaydate}.jpg`;
const browser = await puppeteer.launch({
const fs = require('fs');
const nodemailer = require('nodemailer');
const sendmail = (todaydate) => {
let filename = `geckoboard_${todaydate}.jpg`;
nodemailer.createTestAccount((err, account) => {
let transporter = nodemailer.createTransport({
host: env.EMAIL_HOST, // smtp host
port: 25,