29 Matching Annotations
  1. Jun 2020
    1. You can style the input with the type attribute differenly, like so:

      可以通过这种方式选定特定类型 iniput 元素而不用加类名

    2. Content added using pseudo-elements is only visually displayed. It is not inserted into the DOM. Don’t rely on :before and :after to insert content that is relevant to the meaning and completeness of the content on the page.

      伪类插入的元素仅仅应用于显示,并不插入 dom

    3. On the contrary the same could have been achieved by using the :first-letter pseudo-element selector.

      :first-letter 是个伪类

    1. Note that when you use &::before with content, you need to add quotes to the value of content, otherwise the text does not get applied correctly.

      &:hover{ background-color: ${props => lighten(0.7,themesMap.get(props.theme)!.secondaryColor)}; } &:before{ content: 'before'; }

    1. The CSS above will ONLY select the h1 and h2 within the div. The other h1 and h2 within the p tag will be left unstyled.


    2. If you remember, flex: 1 0 0 says, “grow the container to fit the entire available space, keep the initial width at zero, and don’t shrink the item too”

      让中间部分撑满,自然让顶部和底部 fixed

    3. Remember, the default value for flex-direction is row.

      默认 flex-direction 是 row

    4. Technically, line 2 says, “make sure the minimum height (min-height) of the body element is 100% of the viewport height (vh)”

      让 body 最小高度是100vh

    5. descendant selector - which is based on parent and child relationship.


    6. /* ... */

      css注释:color: red; /Should this be Red or Green? - another comment!/

    1. useCallback returns a memoized callback.

      useCallbak 可以直接看成回调函数,只是他是 memoized 过的

    1. const httpLink = new HttpLink({ uri: 'https://instagram-clone-3.herokuapp.com/v1/graphql' }); const authLink = setContext((_, { headers }) => { const token = accessToken; if (token) { return { headers: { ...headers, authorization: `Bearer ${token}` } }; } else { return { headers: { ...headers } }; } }); const client = new ApolloClient({ link: authLink.concat(httpLink), cache: new InMemoryCache() });

      concat two link

    1. fn another_function(x: i32, y: i32) {     println!("x 的值为 : {}", x);     println!("y 的值为 : {}", y); }


    1. This issue comes from the axios library. In order to fix that, you have to pull out the data property: return this.httpService.post(...) .pipe( map(response => response.data), );

      这是 nest.js 常见错误,获取数据后需要做 map 处理

    1. if the first child in an element has a margin-top,that can merge with the parent's margin-top.所以解决方法就是给 parent 加 padding,只要不 touch 第一个 子元素就不会有这个问题

    1. 盒模型的默认 margin-top 和 margin-bottom 等于其font-size




  2. May 2020
    1. Ujiri said “police have a tough job. But … they are supposed to protect all of us.


    2. A death like this happens, and we rage about it, and the headlines recede, and the world moves on, and then a few weeks later something else happens and we’re outraged again and then we move on, again. We have to stop that cycle,” Ujiri said in the column.


    3. Ujiri, in column that was published Sunday by the Globe and Mail, wrote about his reaction to seeing the video of Floyd, a 46-year-old black man, dying after a Minneapolis police officer pressed his knee into his neck for several minutes, even after he stopped moving and pleading for air last Monday.


    1. const Hello: React.FC<Props> = ({ who }) => (  <p>Hello, {who}</p>);

      最简单的 FC props定义方式

    1. 还要指出的另一点是,长度和大小都可以从其形状中获得:length实际上是第一维的长度,因此等于shape[0],而size是元素的总数,等于元素中所有元素的乘积形元组。
    1. 通常,Arrays用于两种数据结构:queue和stack。 要了解什么queue是食品,您可以想象在食品商店中有一个普通的队列:新人们在队列的末端加入队列,而刚开始的人们则先离开队列。这就是为什么我们需要两种方法来实现的原因queue:一种在的末尾添加元素,Array而另一种在的开始处删除元素的方法queue。这两种方法是push()将一个或多个元素添加到数组的末尾并返回新的数组长度,并shift()删除数组的第零个元素并返回其值:
    2. The slice() method works only with arrays whose elements are strings, numbers, or boolean values.

      只有字符串,数字,布尔值三种类型的数组可以用 slice 操作

    3. Indexes can also be negative. If you specify a negative index in the first parameter, it will shift the end of the sequence. For example, slice(-4) call will extract the last four elements of the sequence:

      index 可以是复数,arr.slice(-4)代表从倒数第四个值到最后

    4. The slice() method does not change the source array, but returns a copy of the array