Skip to content

Instantly share code, notes, and snippets.


Rex Zeng RexSkz

View GitHub Profile
RexSkz / stringify.ts
Created Feb 8, 2022
JSON.stringify with depth limit
View stringify.ts
const stringify = (
obj: any,
replacer?: (this: any, key: string, value: any) => any,
space?: string | number,
depth = Infinity,
): string => {
if (!obj || typeof obj !== 'object') {
return JSON.stringify(obj, replacer, space);
const t = depth < 1
RexSkz / roses-are-red.js
Created Aug 16, 2019 — forked from mutoo/roses-are-red.js
Roses are read, violets are blue. Unexpected token { at line 32.
View roses-are-red.js
// inspired by
console.log('Roses are red, violets are blue.');
RexSkz / nfa-match.go
Last active Feb 8, 2022
A simple code to show how NFA RegExp engine works.
View nfa-match.go
package main
import (
func match(s string, rules []string, sIndex, ruleIndex int) bool {
if ruleIndex == len(rules) {
fmt.Println("match: success")
return true

Keybase proof

I hereby claim:

  • I am rexskz on github.
  • I am skywalker_z ( on keybase.
  • I have a public key ASA3HzI8Fv8-H0PEIMAp_ecppZTq4VD45vHHrO5aJt_dbgo

To claim this, I am signing this object:

RexSkz / prism-javascript.js
Last active Feb 8, 2022
JavaScript file highlight for Prism.js (support function arguments)
View prism-javascript.js
// The prism.js library has already supported identifying function arguments according to:
// Please use the latest version instead.
RexSkz / el-option-test.html
Last active Aug 16, 2017
Too many events are emited when `el-select`'s option changed
View el-option-test.html
<!DOCTYPE html>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<meta name="robots" content="noindex, nofollow">
<meta name="googlebot" content="noindex, nofollow">
<script type="text/javascript" src=""></script>
<script type="text/javascript" src=""></script>
<link rel="stylesheet" type="text/css" href="">
<style type="text/css">