Skip to content

Instantly share code, notes, and snippets.

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

roylee0704

🧘‍♂️
  • Bangkok, Thailand
View GitHub Profile
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 / duplicatedMerchantBooking Test Results
Created June 11, 2019 03:47
Duplicated Booking Marker (Integration Test
Duplicated Merchant Bookings
#triggers
on new booking creation
for any duplicated bookings that occurs within an hour since new booking cr
eation
✓ marks previous booking as duplicated
✓ marks booking of `task_type` = `GoMessenger`
✓ marks booking that is of same `comment`
✓ marks booking that is of same `poi_id`
@roylee0704
roylee0704 / apple-healh-kit-perm.js
Created December 8, 2018 10:57
apple health kit permissions
export const Permissions = {
ActiveEnergyBurned: "ActiveEnergyBurned",
AppleExerciseTime: "AppleExerciseTime",
BasalEnergyBurned: "BasalEnergyBurned",
BiologicalSex: "BiologicalSex",
BloodGlucose: "BloodGlucose",
BloodPressureDiastolic: "BloodPressureDiastolic",
BloodPressureSystolic: "BloodPressureSystolic",
BodyFatPercentage: "BodyFatPercentage",
BodyMass: "BodyMass",
@roylee0704
roylee0704 / docker
Created August 3, 2018 04:25
docker
brew cleanup --prune=0
rm -rf /var/folders/*
See also: `brew cleanup --prune=0` to reclaim disk space.
And `rm -rf /var/folders/*` to remove orphaned temp files.
@roylee0704
roylee0704 / cs.md
Created July 5, 2018 11:32
cheatsheet
  1. du -sk
@roylee0704
roylee0704 / cs.md
Created July 5, 2018 11:32
cheatsheet
  1. du -sk
@roylee0704
roylee0704 / vgo.md
Created July 4, 2018 08:55
vgo user guild
  1. To download vgo
$ go get -u golang.org/x/vgo 
  1. To build lockfile
$ vgo build ./...
@roylee0704
roylee0704 / causer.go
Created June 26, 2018 08:40
pkg/error cause inspector
type errTwo struct{}
func (errTwo) Error() string {
return "errTwo"
}
type errOne struct{}
func (errOne) Error() string {
return "errOne"
@roylee0704
roylee0704 / causer.go
Created June 26, 2018 08:39
pkg/error inspector
type errTwo struct{}
func (errTwo) Error() string {
return "errTwo"
}
type errOne struct{}
func (errOne) Error() string {
return "errOne"
const now = new Date();
const utcNow = new Date(now.getUTCFullYear(), now.getUTCMonth(), now.getUTCDate(), now.getUTCHours(), now.getUTCMinutes(), now.getUTCSeconds(), now.getUTCMilliseconds());
// A js Date object stores 2 primitive values: x and tz, based on y. For instance: new Date(y); IF y = NULL, y = machine time.
// - y = machine time (x + tz)
// - tz = machine tz. i.e: +8
// - console.log(now.toString()) returns (x + tz);