Skip to content

Instantly share code, notes, and snippets.

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

roylee0704

🧘‍♂️
  • Bangkok, Thailand
View GitHub Profile
@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,
"data": {
"item1": {
"inventoryLevel": {
"available": 25
},
"userErrors": []
},
"item2": {
"inventoryLevel": {
mutation {
inventoryBulkAdjustQuantityAtLocation(
locationId: "gid://shopify/Location/1",
inventoryItemAdjustments: [
{inventoryItemId: "gid://shopify/InventoryItem/1", availableDelta: 1},
{inventoryItemId: "gid://shopify/InventoryItem/2", availableDelta: 10}
]) {
inventoryLevels {
available
@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
@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 / vm-setup.sh
Created September 1, 2016 16:31 — forked from nf/vm-setup.sh
Script for setting up Debian Jessie VM with my development environment
#!/bin/bash -e
echo '
PATH=$HOME/go/bin:$PATH
export GOPATH=$HOME
export CDPATH=.:$HOME/src/golang.org/x:$HOME/go/src:$HOME/src/github.com:$HOME/src/github.com/nf:$HOME/src/github.com/adg
export EDITOR=vim
' >> ~/.profile
sudo apt-get update
@roylee0704
roylee0704 / balancer.go
Created May 21, 2016 09:25 — forked from angeldm/balancer.go
Rob Pike balancer for go
package main
import (
"container/heap"
"fmt"
"math/rand"
"time"
)
const nRequester = 100

Setting up Vim as your Go IDE

The final IDE

Intro

I've been wanting to do a serious project in Go. One thing holding me back has been a my working environment. As a huge PyCharm user, I was hoping the Go IDE plugin for IntelliJ IDEA would fit my needs. However, it never felt quite right. After a previous experiment a few years ago using Vim, I knew how powerful it could be if I put in the time to make it so. Luckily there are plugins for almost anything you need to do with Go or what you would expect form and IDE. While this is no where near comprehensive, it will get you writing code, building and testing with the power you would expect from Vim.

Getting Started

I'm assuming you're coming with a clean slate. For me this was OSX so I used MacVim. There is nothing in my config files that assumes this is the case.

@roylee0704
roylee0704 / .vimrc
Last active August 29, 2015 14:22 — forked from sas1ni69/.vimrc
execute pathogen#infect()
filetype plugin on
filetype indent on
let mapleader=","
colorscheme monokai
set background=dark
set clipboard=unnamed