Skip to content

Instantly share code, notes, and snippets.

View jacobgoh101's full-sized avatar

Jacob Goh Chuan Ching jacobgoh101

View GitHub Profile
@jacobgoh101
jacobgoh101 / presign-client.js
Created December 7, 2020 09:59 — forked from adamnator92/presign-client.js
AWS S3 presign
import axios from "axios";
export const getUploadSignedURL = (params) => {
return new Promise((resolve, reject) => {
axios
.get("http://localhost:3000/attachments/upload", {
params,
})
.then((response) => {
resolve(response.data);
@jacobgoh101
jacobgoh101 / machine.js
Last active November 29, 2019 02:38
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
version: "3.1"
services:
db:
image: mysql:8
restart: always
environment:
MYSQL_DATABASE: "nestjsrealworld"
MYSQL_USER: "myuser"
MYSQL_PASSWORD: "mypassword"
@jacobgoh101
jacobgoh101 / builtin.vcl
Created September 18, 2019 07:57
builtin.vcl
# This is the VCL configuration Varnish will automatically append to your VCL
# file during compilation/loading. See the vcl(7) man page for details on syntax
# and semantics.
# New users is recommended to use the example.vcl file as a starting point.
#
# sub vcl_recv {
# if (req.method == "PRI") {
# /* We do not support SPDY or HTTP/2.0 */
# return (synth(405));
# }
USE [emsevents]
GO
/****** Object: Trigger [dbo].[SampleTrigger] Script Date: 6/13/2019 10:50:47 AM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
@jacobgoh101
jacobgoh101 / gulpfile.js
Created April 24, 2018 07:43 — forked from wederer/gulpfile.js
Basic Gulpfile for using Sass with postcss
/* This config file takes an scss file, compiles it to css and
* then uses postcss to minify ("cssnano") the file while also autoprefixing
* ("autoprefixer") and provides additional features like scaling fonts via
* "rucksack".
*
* Usage:
* 1) npm install //installs all packages needed
* 2) gulp watch:scss //watches for changes in any scss file in scssPath
*
*
@jacobgoh101
jacobgoh101 / console.js
Last active November 10, 2018 09:27
Extract dropdown options from webpage
results = [];
obj = $x('xpath' + "/option");
for (var i = 0; i < obj.length; i++) {
results.push({ text: obj[i].text, value: obj[i].value });
}
console.log(JSON.stringify(results));
(async () => {
try {
} catch (err) {
res.rest.forbidden(err);
}
})();
// yarn add vuex vuex-router-sync
import Vuex from 'vuex';
import { sync } from 'vuex-router-sync';
import VuexStore from './vuex/store';
Vue.use(Vuex)
This file has been truncated, but you can view the full file.
{"title":"绝世唐门","author":"唐家三少","publisher":"Jacob Goh","cover":"http://i.imgur.com/HmiTKBb.jpg","content":[{"title":"第一集 天梦冰蚕 引子 神界!唐三一家 - 绝世唐门 - 唐家三少 - ","data":"\n    柔和的光晕宛如母亲的手,轻轻的触摸着云雾的细腻肌肤,虚幻的空间有着异常动人的实质感。隐约中,就在不远处,似乎有着一座巍峨的宫殿,在这柔和的光晕抚触下虚幻而真实。<br />\n<br />\n    一道身影就那么静静的伫立在云雾之间,眺望着无尽的远方,不知道在看着些什么。<br />\n<br />\n    他有着一头宛如瀑布般的水蓝色长发,一直垂到脚下,如果不是他那伟岸的身形和宽阔的肩膀,仅仅从后面去看,恐怕会以为他是个女子。<br />\n<br />\n    华贵的蓝色长袍上仿佛有水波荡漾,如果仔细去看,眼神瞬间就会被那深深的蔚蓝所吸引,甚至整个灵魂都会被吸入那如同大海般深邃、无尽的蓝色之中。<br />\n<br />\n    看上去不过二十多岁的英俊面容上却有着一双深邃的眼眸,他的眼神看似空洞,但却又像是包罗万象,偶尔闪过一道紫意,更是动人心魄。会有一种刹那芳华、瞬间生死寂灭的质感。<br />\n<br />\n    “哎——”男子轻轻的叹息一声,眉宇间多了一丝淡淡的忧伤,双目微合,似乎在感悟着天地至理。<br />\n<br />\n    “三哥。”一声轻轻的呼唤响起。一道身影就那么从虚幻中跨出,来到了那蓝衣男子身边,自然而轻柔的挽住了他的手臂,这仿佛已经做过千百次的动作看上去是那么的圆融如意。<br />\n<br />\n    那是一名身穿粉色长裙的女子,一头长发梳拢成长长的蝎子辫轻轻垂下,从侧后方能够看到她那精致修长的白皙美颈,长裙束腰处盈盈一握,将她那动人的身材完美勾勒出来。<br />\n<br />\n    绝美的容颜上带着一丝淡淡的微笑,搂着那蓝衣男子的手臂,轻轻的将头贴在他的肩膀上,柔顺的蝎子辫也随之晃动,落在男子身后的蓝色长发之上悄然卷曲,将男子的长发缠绕起来。<br />\n<br />\n    蓝衣男子英俊的面庞上流露出一丝有些无奈的宠溺微笑,“都当妈妈了还这么调皮。”<br />\n<br />\n    粉裙女子有些不满的