Skip to content

Instantly share code, notes, and snippets.

@ThaddeusJiang
ThaddeusJiang / git-error.md
Created March 22, 2019 06:53
To choose either option permanently, see push.default in 'git help config'.

when

git push -f 

error message:

To choose either option permanently, see push.default in 'git help config'.
@ThaddeusJiang
ThaddeusJiang / my-mac-setting.md
Last active March 22, 2019 09:51
My Mac setting
$ export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"  # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion"  # This loads nvm bash_completion
@ThaddeusJiang
ThaddeusJiang / date-i18n.md
Created March 21, 2019 05:22
don't need i18n for date

I'd say we don't need to develop i18n for date.

Why?

Because the HTML date-input doesn't do i18n, everybody don't think any problem.

And if we develop i18n for date on some page with date-input, it is confused by two format for date.


@ThaddeusJiang
ThaddeusJiang / dev-js-like-a-boss.md
Created February 20, 2019 06:23
JS 越来越棒了

soon

const street = data && data.user && data.user.address && data.user.address.street;

// better
const street = data.user?.address?.street
@ThaddeusJiang
ThaddeusJiang / 福利项目
Created February 18, 2019 07:45
福利项目
https://github.com/alexkimxyz/nsfw_data_scrapper
@ThaddeusJiang
ThaddeusJiang / Evernote.md
Last active February 18, 2019 04:34
Evernote 保存密码

Evernote 可以将指定文字加密。 只需选中想要加密的文字,右键选择encrypt

encrypt

@ThaddeusJiang
ThaddeusJiang / thefuck.md
Created February 15, 2019 10:50
the fuck -> the love
eval $(thefuck --alias love)
@ThaddeusJiang
ThaddeusJiang / create-react-app-build-error.md
Created February 15, 2019 04:56
Invariant Violation: Minified React error #130; visit https://reactjs.org/docs/error-decoder.html?invariant=130&args[]=undefined&args[]= for the full message or use the non-minified dev environment for full errors and additional helpful warnings.

just happend on build:stg, yarn start is ok.

@ThaddeusJiang
ThaddeusJiang / thefuck.md
Created February 14, 2019 07:01
The fuck configuration

Seems like fuck alias already configured! For applying changes run source ~/.bashrc or restart your shell.

If your MacOSX doesn't have ~/.bashrc, you should set ~/.bash_profile

# The Fuck configuration.
eval $(thefuck --alias)
@ThaddeusJiang
ThaddeusJiang / storybook.js
Created January 30, 2019 09:33
storybook with intl
import * as React from 'react';
import { IntlProvider } from 'react-intl';
import { translationMessages } from 'i18n';
/* eslint-disable import/no-extraneous-dependencies */
import { storiesOf } from '@storybook/react';
import MyComponent from './index';
storiesOf('MyComponent', module)
.add('en', () => (