259 Matching Annotations
  1. Apr 2021
    1. All you need is an email address or phone number associated with an account and you will get a magic link or one-time password each time you want to log in. As soon as you click the link, you'll get redirected to the app and you'll already be logged in. After that, the magic link isn't valid so no one else can use it.
  2. Mar 2021
    1. D3 4.0 is modular. Instead of one library, D3 is now many small libraries that are designed to work together. You can pick and choose which parts to use as you see fit.
    2. To the consternation of some users, 3.x employed Unicode variable names such as λ, φ, τ and π for a concise representation of mathematical operations. A downside of this approach was that a SyntaxError would occur if you loaded the non-minified D3 using ISO-8859-1 instead of UTF-8. 3.x also used Unicode string literals, such as the SI-prefix µ for 1e-6. 4.0 uses only ASCII variable names and ASCII string literals (see rollup-plugin-ascii), avoiding encoding problems.
    3. Microlibraries are easier to understand, develop and test. They make it easier for new people to get involved and contribute. They reduce the distinction between a “core module” and a “plugin”, and increase the pace of development in D3 features.
  3. Feb 2021
    1. An async function simply implies that a promise will be returned and if a promise is not returned, JavaScript will automatically wrap it in a resolved promise with the return value in that function. That would look like writing return Promise.resolve(‘hello’)
    1. [pub_2021] 5 important concepts

      1. Equality == vs. === (primitives, object "mem ref")
      2. Async JS (callbacks, promises, async/await)
      3. Error Handling (try..catch, writing defensive code)
      4. ES6 Syntax (destructuring, spread operator, string interpolation)
      5. Array Methods (map, filter, reduce, sort, some, every)
  4. Jan 2021
  5. Dec 2020
    1. хорошая библиотека для парсинга и автоматизации тестирования "вёрстки с js"

    1. const store = observable({ players: [ "Player 1", "Player 2", ], // ... }) reaction(() => JSON.stringify(store), json => { localStorage.setItem('store',json); }, { delay: 500, }); let json = localStorage.getItem('store'); if(json) { Object.assign(store, JSON.parse(json)); }
  6. Nov 2020
  7. Oct 2020
    1. suite of over 30 separate packages of React visualization primitives that fall into several categories (Figure 2). It is un-opinionated on state management, animation, and styling so it can integrate with any React codebase, and its emphasis on modularity (similar to D3) lets you keep your bundle sizes down by only using the packages you need to create your reusable chart library or a custom one-off chart.

      Short definition of visx

    2. In our research (Figure 1), we found that existing React visualization libraries are often high-level abstractions and optimized for ease of use (i.e., fewer lines of code) at the expense of expressivity. None offer the expressivity of D3 primitives and many don’t allow for the optimization we want in production because computation, animations, state management, styles, and rendering are all encapsulated.

      Comparison of data visualisation libraries:

    3. because D3 and React both want to own DOM manipulation, we’ve found that it’s best to only use D3 for the math and React for the DOM because two mental models for updating the DOM opens the door for bugs to sneak in. However, using D3 solely for math means a significant amount of its (DOM-based) functionality is not available for use: selection.join, zoom, drag, brush, and transitions. Additionally, as mentioned above, D3 has its own learning curve and we would like developers to feel like they are writing native React code with standard APIs and familiar patterns.

      You can use D3 inside a React app, but...

  8. Sep 2020
  9. Jul 2020
    1. One of the best ways is to use “promises,”
    2. function that does something asynchronously should provide a callback argument where we put the function to run after it’s complete
  10. May 2020
    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

      slice()方法是个纯函数

  11. Apr 2020
  12. Mar 2020
    1. "48 61 76 65 20 79 6f 75 20 73 65 65 6e 20 74 68 65 20 73 6f 75 72 63 65 20 63 6f 64 65 20 6f 66 20 74 68 65 20 4a 65 74 42 72 61 69 6e 73 20 77 65 62 73 69 74 65 3f".split(' ').map(ch => String.fromCharCode((parseInt(ch, 16)))).join('')

      js 16进制转字符

  13. Feb 2020
  14. Jan 2020
  15. Dec 2019
    1. If you need polyfills in your code, consider including core-js in your package.json. This is will configure @babel/present-env to automatically include polyfills based on usage.
  16. Nov 2019
  17. Oct 2019
  18. Aug 2019
  19. Jul 2019
    1. Lexical scope is sometimes also referred to as Static Scope.

      Lexical scope only depends on the code text and not on the runtime callstack

  20. Jun 2019
    1. In this article, we are going to talk about the same kind of much-debated back-end programming technologies like Node.Js and PHP! We will know how do they differ from each other and why Node.js vs PHP is such a hot topic among developers.
  21. May 2019
  22. Apr 2019
  23. Feb 2019
    1. Top Reasons Why to Use Node.js for your E-commerce Business

      The arrival of E-commerce has changed how we shop today in our daily lives. Customers are seen buying on social media channels, Mobile apps, and websites. A set of heavy lighting goes behind an instinctive e-commerce website development that is described by the technical expertise that let into building it.

  24. Dec 2018
  25. Nov 2018
  26. Oct 2018