<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by smoothdvd on Medium]]></title>
        <description><![CDATA[Stories by smoothdvd on Medium]]></description>
        <link>https://medium.com/@smoothdvd?source=rss-24b5ff3fa475------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*2OsLwuKTOSiU18_Q.png</url>
            <title>Stories by smoothdvd on Medium</title>
            <link>https://medium.com/@smoothdvd?source=rss-24b5ff3fa475------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 19 Nov 2026 12:46:45 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@smoothdvd/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Add a Customize Users-Permissions Provider for Strapi V4]]></title>
            <link>https://javascript.plainenglish.io/add-a-customize-users-permissions-provider-for-strapi-v4-6aa78c642977?source=rss-24b5ff3fa475------2</link>
            <guid isPermaLink="false">https://medium.com/p/6aa78c642977</guid>
            <category><![CDATA[strapi]]></category>
            <category><![CDATA[nodejs]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[headless-cms]]></category>
            <category><![CDATA[javascript]]></category>
            <dc:creator><![CDATA[smoothdvd]]></dc:creator>
            <pubDate>Sat, 05 Feb 2022 08:53:33 GMT</pubDate>
            <atom:updated>2022-02-21T12:58:26.655Z</atom:updated>
            <content:encoded><![CDATA[<h4>A guide on how to add a Customize Users permissions provider for Strapi V4.</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*JN4jknSpV2OFpQq1" /><figcaption>Photo by <a href="https://unsplash.com/@desola?utm_source=medium&amp;utm_medium=referral">Desola Lanre-Ologun</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p><strong>UPDATED:</strong></p><p>Find a more easy way, according to <a href="https://docs.strapi.io/developer-docs/latest/development/plugins-extension.html#within-the-extensions-folder">Plugins extension — Strapi Developer Docs</a></p><p>in src/extensions/users-permissions/strapi-server.js</p><pre>&#39;use strict&#39;;</pre><pre>module.exports = (plugin) =&gt; {<br> plugin.bootstrap = require(&#39;./server/bootstrap&#39;);<br> plugin.services[&#39;providers&#39;] = require(&#39;./server/services/providers&#39;);<br> <strong>return</strong> plugin;<br>};</pre><p>No need ./src/extensions/users-permissions/server/index.js ./src/extensions/users-permissions/server/service/index.js.</p><p>First we create a folder named “users-permissions” under the src/extensions folder in our project structure according to the Strapi V4 document: <a href="https://docs.strapi.io/developer-docs/latest/development/plugins-extension.html#extending-a-plugin-s-interface">https://docs.strapi.io/developer-docs/latest/development/plugins-extension.html#extending-a-plugin-s-interface</a>.</p><p>Because of Users-Permissions provider is a “server” side plugin code, we need to create a file name strapi-server.js.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/a27ce082c2a236441b18e525a66b7d74/href">https://medium.com/media/a27ce082c2a236441b18e525a66b7d74/href</a></iframe><p>Then we need to create corresponding folders:</p><p>./server/bootstrap and ./server/services.</p><p>Then copy some source codes from node_modules/@strapi/plugin-users-permissions/:</p><p>server/index.js, server/bootstrap/index.js, server/services/index.js, and server/providers.js.</p><p>Finally, we have file and folder structure like this:</p><pre>├──── src<br>│     ├──── <a href="https://docs.strapi.io/developer-docs/latest/development/plugins-extension.html">extensions</a> # files to extend installed plugins<br>│     │     └──── users-permissions<br>│     │           ├──── server<br>│     │           │     └──── bootstrap<br>│     │           │     │     └ index.js <br>│     │           │     └──── services<br>│     │           │     │     └ index.js<br>│     │           │     │     └ providers.js<br>│     │           │     └ index.js  <br>│     │           └ <a href="https://docs.strapi.io/developer-docs/latest/developer-resources/plugin-api-reference/server.html">strapi-server.js</a></pre><p>Before we add our customize provider code, we need to fix the requrie file path first.</p><p>In server/index.js, patch the source code as:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/bc37c36722eddb310ed6d309b2cae4ed/href">https://medium.com/media/bc37c36722eddb310ed6d309b2cae4ed/href</a></iframe><p>In server/bootstrap/index.js, patch the source code as:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/a6c54c3213d09e064671b716a0664e0e/href">https://medium.com/media/a6c54c3213d09e064671b716a0664e0e/href</a></iframe><p>In server/services/index.js, patch the source code as:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/327ee7671e5d1192d6a3e75b8839ad76/href">https://medium.com/media/327ee7671e5d1192d6a3e75b8839ad76/href</a></iframe><p>It’s time to add our customize provider source code now!</p><p>In server/bootstrap/index.js:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/91984e57c0e302ca1bc03da329103337/href">https://medium.com/media/91984e57c0e302ca1bc03da329103337/href</a></iframe><p>In server/services/providers.js:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/19b826ec10f4b8cb5a8bd290fd48c716/href">https://medium.com/media/19b826ec10f4b8cb5a8bd290fd48c716/href</a></iframe><p>And there you have it. Thank you for reading.</p><p><em>More content at </em><a href="http://plainenglish.io/"><strong><em>plainenglish.io</em></strong></a><em>. Sign up for our</em><strong><em> </em></strong><a href="http://newsletter.plainenglish.io/"><strong><em>free weekly newsletter</em></strong></a><em>. Get exclusive access to writing opportunities and advice in our </em><a href="https://discord.gg/GtDtUAvyhW"><strong><em>community Discord</em></strong></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6aa78c642977" width="1" height="1" alt=""><hr><p><a href="https://javascript.plainenglish.io/add-a-customize-users-permissions-provider-for-strapi-v4-6aa78c642977">Add a Customize Users-Permissions Provider for Strapi V4</a> was originally published in <a href="https://javascript.plainenglish.io/">JavaScript in Plain English</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Finally found the correct way to add specific type column in Strapi V4]]></title>
            <link>https://smoothdvd.medium.com/finally-found-the-correct-way-to-add-specific-type-column-in-strapi-v4-3b7f76e8e802?source=rss-24b5ff3fa475------2</link>
            <guid isPermaLink="false">https://medium.com/p/3b7f76e8e802</guid>
            <category><![CDATA[database]]></category>
            <category><![CDATA[headless-cms]]></category>
            <category><![CDATA[postgresql]]></category>
            <category><![CDATA[strapi]]></category>
            <category><![CDATA[javascript]]></category>
            <dc:creator><![CDATA[smoothdvd]]></dc:creator>
            <pubDate>Sat, 22 Jan 2022 02:26:44 GMT</pubDate>
            <atom:updated>2022-01-22T02:28:47.755Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2grkkgrGHq-QK5JhSlwl2A.png" /></figure><p>If you want add some specific type column (such as tstzrange type PostgreSQL offered), you can code like this:</p><p>in schema.json</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/29cb30585bfe34c79d1f4f2bff9b7cb8/href">https://medium.com/media/29cb30585bfe34c79d1f4f2bff9b7cb8/href</a></iframe><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3b7f76e8e802" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Taro-rn: 开发React Native App]]></title>
            <link>https://smoothdvd.medium.com/taro-rn-%E5%BC%80%E5%8F%91react-native-app-7385c625a7d3?source=rss-24b5ff3fa475------2</link>
            <guid isPermaLink="false">https://medium.com/p/7385c625a7d3</guid>
            <category><![CDATA[typescript]]></category>
            <category><![CDATA[taro]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[react]]></category>
            <category><![CDATA[react-native]]></category>
            <dc:creator><![CDATA[smoothdvd]]></dc:creator>
            <pubDate>Thu, 18 Nov 2021 04:55:28 GMT</pubDate>
            <atom:updated>2021-11-23T01:26:34.415Z</atom:updated>
            <content:encoded><![CDATA[<p>不定期记录开发时遇到问题及解决方法</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ON7s5NaIQOGN9JDjZdyERQ.jpeg" /></figure><p>Update at 2021.11.23</p><p><strong>Taro-rn中（也许）可用的jest配置</strong></p><p><strong><em>注意：jest-expo版本必须低于43，jestt版本为26.4.2。</em></strong></p><p>jest.config.js</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/82332dba2cca63af3a9c10bae05b9417/href">https://medium.com/media/82332dba2cca63af3a9c10bae05b9417/href</a></iframe><p>babel.config.js</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/19baaba24ca8dab08d5f2bf077943d30/href">https://medium.com/media/19baaba24ca8dab08d5f2bf077943d30/href</a></iframe><p>example</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/181c0ef5e4b55e80b43ec78d80a28ddb/href">https://medium.com/media/181c0ef5e4b55e80b43ec78d80a28ddb/href</a></iframe><p>Update at 2021.11.18</p><p><strong>在Taro-rn或React Native项目中使用uuid或crypto-js</strong></p><p>解决方法：</p><p>添加react-native-get-random-values</p><p><strong>加入crypto-js后出现Require Cycle的警告</strong></p><blockquote>WARN Require cycle: node_modules/metro/src/node-haste/DependencyGraph/assets/empty-module.js -&gt; src/pages/index/index.tsx -&gt; src/utils/hzxw-api-client.ts -&gt; node_modules/crypto-js/index.js -&gt; node_modules/crypto-js/core.js -&gt; node_modules/metro/src/node-haste/DependencyGraph/assets/empty-module.js</blockquote><p>解决方法：</p><p>引用crypto-js的顺序必须在react-native-get-random-values</p><p>import ‘react-native-get-random-values’;</p><p>import CryptoJS from ‘crypto-js’;</p><p><strong>调用Taro.navigateTo方法后，无法导航到新页面：</strong></p><p>例如如下错误信息</p><blockquote>ERROR The action ‘PUSH’ with payload {“name”:”pagesArticleDetail”,”params”:{“aid”:”17643197&quot;}} was not handled by any navigator.</blockquote><blockquote>Do you have a screen named ‘pagesArticleDetail’?</blockquote><blockquote>If you’re trying to navigate to a screen in a nested navigator, see <a href="https://reactnavigation.org/docs/5.x/nesting-navigators#navigating-to-a-screen-in-a-nested-navigator">https://reactnavigation.org/docs/5.x/nesting-navigators#navigating-to-a-screen-in-a-nested-navigator</a>.</blockquote><blockquote>This is a development-only warning and won’t be shown in production.</blockquote><p>解决方法：</p><ol><li>在app.config.ts中的pages添加新页面的url</li><li>启动时添加--reset-cache清空metro缓存</li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7385c625a7d3" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Make Tabnine Great Again on Apple Silicon M1]]></title>
            <link>https://smoothdvd.medium.com/make-tabnine-work-great-again-on-apple-silicon-m1-f889f728ca53?source=rss-24b5ff3fa475------2</link>
            <guid isPermaLink="false">https://medium.com/p/f889f728ca53</guid>
            <category><![CDATA[vscode]]></category>
            <category><![CDATA[vscode-extension]]></category>
            <category><![CDATA[apple-silicon]]></category>
            <category><![CDATA[m1]]></category>
            <category><![CDATA[tabnine]]></category>
            <dc:creator><![CDATA[smoothdvd]]></dc:creator>
            <pubDate>Mon, 28 Dec 2020 05:51:24 GMT</pubDate>
            <atom:updated>2021-01-19T03:52:20.155Z</atom:updated>
            <content:encoded><![CDATA[<h3>Make Tabnine Great Again on Apple M1 Chip</h3><blockquote>UPDATE: Tabnine update their Visual Studio Code extension to support Apple Silicon from 3.2.1.</blockquote><p>Microsft has released <a href="https://code.visualstudio.com/insiders/">Visual Studio Code</a> <a href="https://code.visualstudio.com/insiders/">Insider version</a> which supports Apple M1 chip after Apple announced new MacBook Air, Macbook Pro and Mac mini supercharged by Apple M1 chip.</p><p>We can install the Tabnine extension as usual, but Tabnine binary does not run after restarting the VSCode.</p><p>This is because of Tabnine extension requires Tabnine binary executable to run, and there is no arm64 version of the Tabnine binary available now.</p><p>However, in macOS Big Sur, Apple allow users to run apps that contain x86_64 instructions on Apple silicon which called “Rosetta Translation Environment”. Thanks to Rosetta 2, we can still run Tabnine x86_64 binary in macOSBig Sur.</p><p>First, we need find where the Tabnine extension is installed, normally it installed at <strong><em>$HOME/.vscode/extensions/tabnine.tabnine-vscode-version</em></strong> (VSCode Insider version is .vscode-insider and VSCode Exploration version is .vscode-exploration).</p><p>In the Tabnine extension installation folder, we will find a folder named <strong><em>binaries.</em></strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qHwdVl4rPXPGx6UMZJ8ZVA.png" /></figure><p>In the versioned (<strong><em>3.2.63</em></strong>) folder, we can see the binaries for different architecture and operating systems. We can simply duplicate the x86_64-apple-darwin folder and rename it to arm64-apple-darwin.</p><p>Next, we need to open a file named paths.js in a folder named <strong><em>out/binary</em></strong> with a text editor (I use vim) and add the following lines to the <strong><em>function getArch()</em></strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*q3ftEVU42ALi9-3Gt_rLfg.png" /><figcaption>The highlighted text is the added code</figcaption></figure><pre>if (process.arch === &quot;arm64&quot;) {<br>    return &quot;arm64&quot;<br>}</pre><p>Finally, we need to restart VSCode!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bbjkFZCmc55q0GdbF5alBw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cPNuG-0hCk-LdBKHIDtdlg.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f889f728ca53" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Docker learning tips]]></title>
            <link>https://smoothdvd.medium.com/docker-learning-tips-84b2e8c0e7f9?source=rss-24b5ff3fa475------2</link>
            <guid isPermaLink="false">https://medium.com/p/84b2e8c0e7f9</guid>
            <category><![CDATA[docker]]></category>
            <category><![CDATA[ca-certificates]]></category>
            <dc:creator><![CDATA[smoothdvd]]></dc:creator>
            <pubDate>Wed, 18 Mar 2020 05:47:07 GMT</pubDate>
            <atom:updated>2020-03-18T05:48:26.232Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*8Whuhvn281MsTvsF" /><figcaption>Photo by <a href="https://unsplash.com/@diesektion?utm_source=medium&amp;utm_medium=referral">Robert Anasch</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>CA certificates issue</p><p>If you access a url in docker image base ubuntu, you will maybe have this problem:</p><blockquote>x509: certificate signed by unknown authority</blockquote><p>To solve this issue, you should install “ca-certificates” in Dockerfile like this</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/c66c51476c72c98ed9f6025854d48156/href">https://medium.com/media/c66c51476c72c98ed9f6025854d48156/href</a></iframe><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=84b2e8c0e7f9" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Be careful when you use findFragmentByTag()]]></title>
            <link>https://smoothdvd.medium.com/be-careful-when-you-use-findfragmentbytag-988141ea32cf?source=rss-24b5ff3fa475------2</link>
            <guid isPermaLink="false">https://medium.com/p/988141ea32cf</guid>
            <category><![CDATA[android-app-development]]></category>
            <category><![CDATA[fragments]]></category>
            <category><![CDATA[androiddev]]></category>
            <dc:creator><![CDATA[smoothdvd]]></dc:creator>
            <pubDate>Fri, 27 Apr 2018 11:28:43 GMT</pubDate>
            <atom:updated>2018-04-27T11:29:56.753Z</atom:updated>
            <content:encoded><![CDATA[<p>Recently I met NPE error reported by Crashlytics:</p><blockquote>java.lang.NullPointerException: Attempt to invoke virtual method ‘void android.support.v4.app.Fragment.setNextAnim(int)’ on a null object reference<br> at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2817)<br> at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2892)<br> at android.app.ActivityThread.-wrap11(Unknown Source)<br> at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1593)<br> at android.os.Handler.dispatchMessage(Handler.java:105)<br> at android.os.Looper.loop(Looper.java:164)<br> at android.app.ActivityThread.main(ActivityThread.java:6541)<br> at java.lang.reflect.Method.invoke(Method.java)<br> at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:240)<br> at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:767)</blockquote><p>My activity has such lines like:</p><pre><strong>final </strong>FragmentManager fragmentManager = getSupportFragmentManager();<br>FragmentTransaction fragmentTransaction = fragmentManager.beginTransaction();<br><strong>if </strong>(fragmentManager.findFragmentByTag(&quot;foo&quot;)<strong> </strong>== <strong>null</strong>) {<br>    <strong>fooFragment </strong>= <strong>new </strong>FooFragment();<br>    fragmentTransaction.add(R.id.<strong><em>root_container</em></strong>, <strong>fooFragment</strong>, <strong>&quot;root&quot;</strong>);<br>} <strong>else </strong>{<br>    fragmentTransaction.show(<strong>fooFragment</strong>);<br>}<br>fragmentTransaction.commit();</pre><p>In some condition, Android system will kill process and activity will re-enter onCreate(), and then fooFragment will be null.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/513/0*wDWGBkL3uHViqoyr.png" /><figcaption>A simplified illustration of the activity lifecycle.</figcaption></figure><p>BUT, If you use findFragmentByTag method to retrieve a fragment, you will find the returned fragment IS NOT NULL!</p><p>In document from Android, it says:</p><blockquote>Get fragments that exist in the activity, with <a href="https://developer.android.com/reference/android/support/v4/app/FragmentManager.html#findFragmentById(int)">findFragmentById()</a> (for fragments that provide a UI in the activity layout) or <a href="https://developer.android.com/reference/android/support/v4/app/FragmentManager.html#findFragmentByTag(java.lang.String)">findFragmentByTag()</a> (for fragments that do or don&#39;t provide a UI).</blockquote><blockquote>So, just use <em>findFragmentById() to correctly find fragment.</em></blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=988141ea32cf" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>