导航

    • 登录
    • 搜索
    • 版块
    • 最新
    • 话题
    • 热门
    • 用户
    • 群组
    1. 主页
    2. 梵总
    3. 帖子
    梵
    • 继续与 梵总 聊天
    • 开始与 梵总 的新会话
    • 举报资料
    • block_user
    • 资料
    • 关注
    • 粉丝
    • 主题
    • 帖子
    • 最佳
    • 群组

    梵总 发布的帖子

    • about async with useEffect

      https://devtrium.com/posts/async-functions-useeffect

      发布在 笔记
      梵
      梵总
    • group by & count array of objects

      const allPubs = rows.reduce((ac, item) => {
      const idx = ac.findIndex((x) => x.publicationName === item.publicationName);
      console.log("IDX", idx);
      if (idx === -1) {
      ac.push(item);
      } else {
      ac[idx].publicationQty += item.publicationQty;
      }
      return ac;
      }, []);

      const sortedRows = orderBy(allPubs, ["publicationQty"], ["desc"]);

      发布在 React
      梵
      梵总
    • RE: write to Excel on the client side
      const xslsHeaders = [type, "Total", "Percentage"];
      const sheetData = [[type, "", ""], [dateRange, "", ""], xslsHeaders, ...main];
      
      onClick={() => exportFile(`${type} ${dateRange}`, sheets)}
      
      发布在 笔记
      梵
      梵总
    • Fix Href Interpolation Failed error

      https://nextjs.org/docs/messages/href-interpolation-failed

      const handlePaginationChange = async (value) => {
          // await fetchRecords(scope, value - 1);
          // setActivePage(value);
          const params = {
            pathname: "/clubs/[slug]",
            query: { slug: lsc, page: value },
          };
          router.push(params, undefined, { shallow: true });
          window && window.scroll({ top: 0, behavior: "smooth" });
        };
      
      发布在 笔记
      梵
      梵总
    • write to Excel on the client side

      https://github.com/SheetJS/sheetjs/tree/f78c866cf4c87c1d3ff6ab6c3841feaefc302b61/demos/react

      发布在 笔记
      梵
      梵总
    • start serverless with different port
      "its": "sls offline start --stage=localits --noAuth --noTimeout --httpPort=4000 --lambdaPort=4002"
      发布在 笔记
      梵
      梵总
    • kill process on linux
      kill $(ps aux | grep '[p]hp' | awk '{print $2}')
      

      https://rtcamp.com/tutorials/linux/kill-all-processes/

      发布在 笔记
      梵
      梵总
    • mongodb sort by date

      https://stackoverflow.com/questions/39021363/mongodb-sorting-date-string-mm-dd-yyyy/47798239

      发布在 笔记
      梵
      梵总
    • use Env variable in public.html for create react app
      <script type="text/javascript">
        console.log("CODEBUILDNUMBER: ", "%REACT_APP_CODEBUILD_BUILD_ID%"); // code build number if any
        console.log("%NODE_ENV%"); // development
      </script>
      发布在 笔记
      梵
      梵总
    • remote access to your WSL

      Great tutorial:
      https://www.illuminiastudios.com/dev-diaries/ssh-on-windows-subsystem-for-linux/

      In my case, the WSL should be on the main network, i.e. 192.168.1., not on the subNetwork like mesh wifi network, ex: 192.168.4. (which is a subnetwork of the mesh network 192.168.1.*)

      发布在 笔记
      梵
      梵总
    • Twitter

      Blackbird singing in the dead of night
      Take these broken wings and learn to fly
      All you life
      You were only waiting for this moment to fly

      -- Beatles

      发布在 笔记
      梵
      梵总
    • Learn WGET

      https://www.baeldung.com/linux/curl-wget#:~:text=The main difference between them,download it into a file.

      发布在 笔记
      梵
      梵总
    • mongodb advanced query

      https://coderedirect.com/questions/211313/mongodb-projection-of-nested-arrays

      发布在 笔记
      梵
      梵总
    • Build Search With Semantic UI

      https://react.semantic-ui.com/modules/search/#types-category-custom

      发布在 笔记
      梵
      梵总
    • PHP is not a good language talking to MongoDB

      It's just too hard. Even for finding a doc. Found this live saver:

      The BSONDocument object has a jsonSerialize method. Use that:
      
      Example
      
      {"_id" : 12345,
          "filename" : "myfile",
          "header" : {
              "version" : 2,
              "registry" : "test",
              "serial" : 20080215,
              "records" : 17806,
              "startDate" : 19850701,
              "endDate" : 20080214
          },
      }
      
      $connect = new MongoDB\Client('mongodb://yourconnection');
      $db = $connect->YourDB;
      $collection = $db->YourCollection;
      
      $test = $collection->findOne(array("_id"=>12345));
      $data = $test->jsonSerialize();
      
      echo $data->_id;
      echo $data->filename;
      Will output this:
      
      12345
      myfile 
      
      发布在 笔记
      梵
      梵总
    • Swimming Photography

      https://olavistaphotography.com/

      发布在 笔记
      梵
      梵总
    • DYNAMODB Admin

      https://github.com/aaronshaf/dynamodb-admin

      发布在 笔记
      梵
      梵总
    • To be who you are

      Every disadvantage can be turned into an advantage for yourself so accept yourself for who you are, be aware of your potential and do your best.

      -- Rumeysa Gelgi - world's tallest living woman 2021 (215.15cm)

      发布在 笔记
      梵
      梵总
    • Git issues - package-lock.json

      Says we have B1 and B2 both are created from master.
      B1 has some updates to package.json.
      B2 has some updates to package.json as well.

      After B1 merged into master, B2 is ready. Submit the pull request, there will be some code conflict due to package-lock.json. It's almost impossible to resolve this.

      Here is what you can do on your local:

      git checkout B2
      git merge origin master
      

      Yes, you need to resolve the conflict, just accept all current changes on package-lock.json, and carefully resolve the conflicts on package.json and other files. And stage the changes, and then merge the master into B2

      The next step, which is very important, because package-lock.json is not valid now, so simplet remove it and regenerate it by npm install

      Then commit B2 and submit the pull request.

      Cheer!

      发布在 笔记
      梵
      梵总
    • Change benifit

      Please obtain a letter from her employer showing the dates her employment and benefits will end

      发布在 英语Fun
      梵
      梵总