Skip to content

Instantly share code, notes, and snippets.

View roylee0704's full-sized avatar
🧘‍♂️

roylee0704

🧘‍♂️
  • Bangkok, Thailand
View GitHub Profile
@roylee0704
roylee0704 / 0_reuse_code.js
Created January 20, 2017 08:16
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@roylee0704
roylee0704 / Makefile
Created April 10, 2017 11:43 — forked from mpneuried/Makefile
Simple Makefile to build, run, tag and publish a docker containier to AWS-ECR
# import config
configfile=config.env
ifdef cnf
configfile=$(cnf)
endif
include $(configfile)
export $(shell sed 's/=.*//' $(configfile))
# import deploy config
deployfile=deploy.env
mutation {
inventoryBulkAdjustQuantityAtLocation(
locationId: "gid://shopify/Location/1",
inventoryItemAdjustments: [
{inventoryItemId: "gid://shopify/InventoryItem/1", availableDelta: 1},
{inventoryItemId: "gid://shopify/InventoryItem/2", availableDelta: 10}
]) {
inventoryLevels {
available
"data": {
"item1": {
"inventoryLevel": {
"available": 25
},
"userErrors": []
},
"item2": {
"inventoryLevel": {
@roylee0704
roylee0704 / html2pdf.js
Created July 5, 2020 14:31 — forked from antfu/html2pdf.js
HTML to PDF
import puppeteer from 'puppeteer'
import fs from 'fs'
async function buildPDF(htmlString) {
const browser = await puppeteer.launch({ headless: true })
const page = await browser.newPage();
await page.setContent(htmlString, { waitUntil: 'networkidle0' })
const pdf = await page.pdf({
format: 'A4',
displayHeaderFooter: false,