Skip to content

Instantly share code, notes, and snippets.

View nodejh's full-sized avatar
🤖

Hang Jiang nodejh

🤖
View GitHub Profile
@nodejh
nodejh / v8.md
Created August 25, 2021 02:57 — forked from kevincennis/v8.md
V8 Installation and d8 shell usage

Installing V8 on a Mac

Prerequisites

  • Install Xcode (Avaliable on the Mac App Store)
  • Install Xcode Command Line Tools (Preferences > Downloads)
  • Install depot_tools
    • git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git
    • sudo nano ~/.bash_profile
  • Add export PATH=/path/to/depot_tools:"$PATH" (it's important that depot_tools comes first here)
let lastValue = input.value;
input.value = value;
let event = new Event ('input', {bubbles: true});
// hack React15
event.simulated = true;
// hack React16 内部定义了descriptor拦截value,此处重置状态
let tracker = input._valueTracker;
if (tracker) {
tracker.setValue (lastValue);
}
const https = require('https')
const options = {
hostname: 'flaviocopes.com',
port: 443,
path: '/todos',
method: 'GET'
}
const req = https.request(options, (res) => {
console.log(`statusCode: ${res.statusCode}`)
```
git diff --name-only --diff-filter=U
```
https://stackoverflow.com/questions/3065650/whats-the-simplest-way-to-get-a-list-of-conflicted-files
```
/* Child.js */
import React from 'react'
import withStyles from 'isomorphic-style-loader/lib/withStyles'
import s from './Child.css'
class Child extends React.Component {
componentDidMount() {
this.props.onRef(this)
}
@nodejh
nodejh / git Changing author info
Created July 15, 2018 10:45
git Changing author info
// https://help.github.com/articles/changing-author-info/
#!/bin/sh
git filter-branch --env-filter '
OLD_EMAIL="your-old-email@example.com"
CORRECT_NAME="Your Correct Name"
CORRECT_EMAIL="your-correct-email@example.com"
if [ "$GIT_COMMITTER_EMAIL" = "$OLD_EMAIL" ]
then
div content editor able waring
https://discuss.reactjs.org/t/setting-text-to-contenteditable-element-issues-warning/891/7
@nodejh
nodejh / javascriptEnabled
Created July 6, 2018 15:13
Inline JavaScript is not enabled. Is it set in your options?
// https://github.com/ant-design/ant-design/issues/7927#
// https://github.com/ant-design/ant-motion/issues/44
config = rewireLess.withLoaderOptions({
javascriptEnabled: true
})(config, env);
@nodejh
nodejh / cra-antd-less-module
Created July 6, 2018 15:12
cra antd css/less module
// https://github.com/timarney/react-app-rewired/issues/116
const path = require("path");
const { compose, getLoader, injectBabelPlugin } = require("react-app-rewired");
const rewireLessModules = (prefix = "", lessOptions = {}) => {
const cloneDeep = require("lodash/clonedeep");
const ruleChildren = loader =>
@nodejh
nodejh / vim
Last active July 3, 2018 16:17
## 在多行的前面添加
https://www.ibm.com/developerworks/cn/linux/l-cn-vimcolumn/index.html
技巧:Vim 的纵向编辑模式
## 复制多行
shit v,yy,p