Skip to content

Instantly share code, notes, and snippets.

View RexSkz's full-sized avatar

Rex Zeng RexSkz

View GitHub Profile
RexSkz / stringify.ts
Created February 8, 2022 03:57
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 August 16, 2019 08:30 — 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 February 8, 2022 04:23
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
RexSkz /
Last active November 10, 2022 11:38

Keybase proof

I hereby claim:

  • I am rexskz on github.
  • I am skywalker_z ( on keybase.
  • I have a public key whose fingerprint is 8204 043E 7986 B839 4040 B47C C45E EA5D FACD 1B70

To claim this, I am signing this object:

RexSkz / prism-javascript.js
Last active February 8, 2022 04:07
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 August 16, 2017 07:12
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">