Skip to content

Instantly share code, notes, and snippets.

@SamHwang1990
SamHwang1990 / ssr_test.go
Created July 31, 2020 10:11 — forked from xeoncross/ssr_test.go
Example of using chromedp to prerender a create-react-app frontend using fake SSR via chrome headless
package main
import (
"context"
"io/ioutil"
"log"
"strings"
"testing"
"github.com/chromedp/cdproto/dom"
@SamHwang1990
SamHwang1990 / apollo-link-subscriptions
Last active September 29, 2018 05:11
apollo-link-subscripions
@SamHwang1990
SamHwang1990 / 匹配Email地址的正则表达式
Created January 4, 2017 18:46
匹配Email地址的正则表达式
/*
Email的规则: name@domain
name最长64,domain最长253,总长最长256
name可以使用任意ASCII字符:
大小写英文字母 a-z,A-Z
数字 0-9
字符 !#$%&'*+-/=?^_`{|}~
字符 .不能是第一个和最后一个,不能连续出现两次
但是有些邮件服务器会拒绝包含有特殊字符的邮件地址
domain仅限于26个英文字母、10个数字、连词号-
@SamHwang1990
SamHwang1990 / blog-webpack-2.md
Created March 22, 2016 02:32 — forked from xjamundx/blog-webpack-2.md
From Require.js to Webpack - Part 2 (the how)

This is the follow up to a post I wrote recently called From Require.js to Webpack - Party 1 (the why) which was published in my personal blog.

In that post I talked about 3 main reasons for moving from require.js to webpack:

  1. Common JS support
  2. NPM support
  3. a healthy loader/plugin ecosystem.

Here I'll instead talk about some of the technical challenges that we faced during the migration. Despite the clear benefits in developer experience (DX) the setup was fairly difficult and I'd like to cover some of the challanges we faced to make the transition a bit easier.