***********************************************************
try...catch VS safe-touch
Will run 100,000 times for each test case.
Will test with these retrieve methods:
function impossibleRetrieve(_) { return _[Math.random()][Math.random()] }
function shallowRetrieve(_) { return _.key }
function deepRetrieve(_) { return _.a.b.c.d.e.f.g.h.i }
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<title>Luck Money</title> | |
<style> | |
* { | |
margin: 6px; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const http = require('http') | |
const options = { | |
host: 'wx.ecnu.edu.cn', | |
path: '/CorpWeChat/card/dogetEle.html', | |
method: 'POST', | |
headers: { | |
'X-Requested-With': 'XMLHttpRequest', | |
'Content-Type': 'application/x-www-form-urlencoded' | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = function decorate(func) { | |
const f = func() | |
return (function run(input) { f.next(input).then(run) })() | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class _ControllerX extends React.Component { | |
static propTypes = { | |
forwardRef: PropTypes.func | |
} | |
ref = r => this.r = r | |
someCallback() { | |
this.r.method() | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const globalData = [] | |
class Component extends React.Component { | |
componentDidMount() { | |
setInterval(() => { | |
globalData.push(0) | |
this.setState((count = 0) => count + 1,) | |
}, 100) | |
} | |
render() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Usages | |
* | |
* native tags | |
* styled.div`color: red;` | |
* | |
* custom components | |
* styled((props) => <div {...props} />)`color: red;` | |
* | |
*/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Available variables: | |
// - Machine | |
// - interpret | |
// - assign | |
// - send | |
// - sendParent | |
// - spawn | |
// - raise | |
// - actions |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// install dependencies first: | |
// $ yarn add jest jest-puppeteer puppeteer -D | |
const path = require('path') | |
const CRX_PATH = path.resolve(__dirname, 'path/to/local/extension/dir') | |
module.exports = { | |
launch: { | |
headless: false, // required for loading extensions |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[user] | |
name = globalName | |
email = [email protected] | |
useConfigOnly = true # recommended to keep | |
[includeIf "gitdir:~/special-workspace/"] | |
path = ~/special.gitconfig |
OlderNewer