Fork me on GitHub
  1. Google Chrome 控制台

    console

    console.log(object [, object, ...])

    console.info(object [, object, ...])

    console.error(object [, object, ...])

    var str = 'hello world';
    console.log('--->>>%s', str);
    

    常用格式代码:

    说明符 输出
    %s 将值格式化为字符串
    %i 或 %d 将值格式化 …
    read more

    There are comments.

  2. google push-notifications

    按照教程添加前端

    https://developers.google.com/web/fundamentals/codelabs/push-notifications?hl=zh-cn

    后端服务使用web-push

    需要审核key:

    https://console.firebase.google.com/project/test-22de3/settings/cloudmessaging/web:Mzg2N2Q4MzgtNmY5MS00YTAzLTkzYTItMDc2NTczZWJkYmE2?hl=zh-cn

    服务端需要能正 …

    read more

    There are comments.

  3. Catalina 10.15.4无法使用SSH域名登录

    https://tyler.io/so-uh-i-think-catalina-10154-broke-ssh/

    方案一

    .ssh/config文件添加 ProxyCommand nc %h %p

    如:

    host vps
    hostname xx.xxx.com
    user root
    ProxyCommand nc %h %p
    

    方案二

    brew install openssh

    ~/.bash_profile 添加: export PATH="/usr/local/sbin:$PATH"

    source ~/.bash_profile

    read more

    There are comments.

  4. JS中toFixed的坑

    重点:toFixed不是四舍五入

    MDN:

    toFixed() 方法使用定点表示法来格式化一个数。

    Chrome:

    console.log((0.005).toFixed(2)) -> 0.01
    console.log((0.015).toFixed(2)) -> 0.01
    console.log((0.025).toFixed(2)) -> 0.03
    console.log((0.035 …
    read more

    There are comments.

  5. 前端的不可见字符

    https://stackoverflow.com/questions/11598786/how-to-replace-non-printable-unicode-characters-javascript

    most of which are quite printable

    https://blog.csdn.net/ranjio_z/article/details/51993040?utm_source=blogxgwz8

    http://www.unicode.org/charts/PDF/U2000.pdf

    unicode 显示符号
    \u2000  
    \u2001
    \u2002
    \u2003
    \u2004
    \u2005
    \u2006
    \u2007
    \u2008
    \u2009
    \u200a
    \u200b
    \u200c
    \u200d
    \u200e …
    read more

    There are comments.

links