<?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 Alexey Berezin on Medium]]></title>
        <description><![CDATA[Stories by Alexey Berezin on Medium]]></description>
        <link>https://medium.com/@beraliv?source=rss-5e027945073e------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*zZlZM-dhYyvnTVPL1XXGEw.png</url>
            <title>Stories by Alexey Berezin on Medium</title>
            <link>https://medium.com/@beraliv?source=rss-5e027945073e------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 21 Nov 2026 01:24:35 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@beraliv/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[Advanced Typed Get]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://beraliv.medium.com/advanced-typed-get-7dfdd6990a3?source=rss-5e027945073e------2"><img src="https://cdn-images-1.medium.com/max/1274/1*Xo3rfaScbtVKZJFELdvlJw.png" width="1274"></a></p><p class="medium-feed-snippet">Not a long time ago I discovered type-challenges for myself. Today I&#x2019;ll show not only the implementation of Get, but also some common&#x2026;</p><p class="medium-feed-link"><a href="https://beraliv.medium.com/advanced-typed-get-7dfdd6990a3?source=rss-5e027945073e------2">Continue reading on Medium »</a></p></div>]]></description>
            <link>https://beraliv.medium.com/advanced-typed-get-7dfdd6990a3?source=rss-5e027945073e------2</link>
            <guid isPermaLink="false">https://medium.com/p/7dfdd6990a3</guid>
            <category><![CDATA[typescript]]></category>
            <category><![CDATA[type-challenge]]></category>
            <dc:creator><![CDATA[Alexey Berezin]]></dc:creator>
            <pubDate>Sun, 04 Apr 2021 15:47:48 GMT</pubDate>
            <atom:updated>2021-04-04T15:47:48.633Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[Research Joyn scripts obfuscation]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://beraliv.medium.com/research-joyn-scripts-obfuscation-d33b0e64f86d?source=rss-5e027945073e------2"><img src="https://cdn-images-1.medium.com/max/2600/1*5KltaLxLqTxyFuYQxRvEEA.png" width="3758"></a></p><p class="medium-feed-snippet">Joyn (previously 7TV) is German &#x201C;Netflix&#x201D; which has films, TV series and live TV. Let&#x2019;s have a look at the player closer.</p><p class="medium-feed-link"><a href="https://beraliv.medium.com/research-joyn-scripts-obfuscation-d33b0e64f86d?source=rss-5e027945073e------2">Continue reading on Medium »</a></p></div>]]></description>
            <link>https://beraliv.medium.com/research-joyn-scripts-obfuscation-d33b0e64f86d?source=rss-5e027945073e------2</link>
            <guid isPermaLink="false">https://medium.com/p/d33b0e64f86d</guid>
            <category><![CDATA[video-player]]></category>
            <category><![CDATA[video-development]]></category>
            <category><![CDATA[javascript]]></category>
            <dc:creator><![CDATA[Alexey Berezin]]></dc:creator>
            <pubDate>Mon, 04 May 2020 18:29:46 GMT</pubDate>
            <atom:updated>2020-05-11T11:44:35.269Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[What’s inside Udemy player?]]></title>
            <link>https://beraliv.medium.com/whats-inside-udemy-player-82a21387133a?source=rss-5e027945073e------2</link>
            <guid isPermaLink="false">https://medium.com/p/82a21387133a</guid>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[video-player]]></category>
            <category><![CDATA[video-development]]></category>
            <dc:creator><![CDATA[Alexey Berezin]]></dc:creator>
            <pubDate>Tue, 07 Jan 2020 19:58:02 GMT</pubDate>
            <atom:updated>2020-01-07T22:55:23.803Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3IntNzJDlbivARHcKdQ44g.png" /></figure><p>I’ve discovered Udemy as a service around 5–6 years ago. Below you can read what I found interesting having a look at the player during several hours.</p><h3>WebVTT</h3><p>The Web Video Text Tracks Format, or WebVTT, is a <a href="https://www.w3.org/TR/webvtt1/">specification</a> to mark up external text track resources and put them to &lt;track&gt; elements.</p><p>There is an implementation for Node.js and browsers which is called vtt.js (versions by <a href="https://github.com/videojs/vtt.js">VideoJS</a> and <a href="https://github.com/mozilla/vtt.js">Mozilla</a>).</p><p>It turns out Udemy uses VideoJS <a href="https://vjs.zencdn.net/vttjs/0.12.4/vtt.min.js">version 0.12.4</a> (28 Apr 2017) as a <a href="https://gist.github.com/Beraliv/92a80cd531cd8e0535f7fabd05fda88d#file-vendor-videojs-js-L2517">fallback value</a>. The version for me was <a href="https://www.udemy.com/staticx/udemy/js/node_modules/videojs-vtt.js/dist/vtt.min.js?v=328c99057dda7916bc39228043cb195e1cf8acef">0.12.6</a> (13 Feb 2018).</p><p>VTT-files look like that:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0WcUg1ODM54S3eZC57rBUg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0KQaupOQ-FWI4dPLyZVSOg.gif" /><figcaption><strong>innerText</strong> is updated based on data from VTT</figcaption></figure><p>Udemy also uses WebVTT to show a popover using thumbnail sprites:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*iXptqCC7VYSCw2wb75AgaA.png" /><figcaption><a href="https://gist.github.com/Beraliv/92a80cd531cd8e0535f7fabd05fda88d#file-vendor-videojs-js-L12507">VideoJS sneakpeek</a> is used to parse VTT sprites. Find more at <a href="https://github.com/udemy/videojs-sneakpeek">videojs-sneakpeek</a></figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gNJIT1hGZDbOAKFZDJhXKg.gif" /><figcaption><strong>left</strong>, <strong>top</strong> and <strong>clip</strong> are changed based on data from VTT</figcaption></figure><h3>Statistics</h3><p>Video player development isn’t obvious: it includes browser-specific features (e.g. <a href="https://caniuse.com/#feat=fullscreen">Fullscreen API</a>, <a href="https://caniuse.com/#search=Promise">Promise</a>, <a href="https://caniuse.com/#search=JavaScript%20modules%20via%20script%20tag">JavaScript modules via script tag</a>, etc), depends on the other libraries which are used (e.g. <a href="https://github.com/video-dev/hls.js/#compatibility">hls.js</a>,<a href="https://github.com/google/shaka-player#platform-and-browser-support-matrix"> shaka-player</a>, <a href="https://videojs.com/html5-video-support/">videojs</a> and so on). This is why it’s a general approach to send player events and to analyse data later.</p><p>Udemy uses XMLHttpRequest in <a href="https://gist.github.com/Beraliv/92a80cd531cd8e0535f7fabd05fda88d#file-vendor-videojs-js-L11123">_sendBeaconQueu</a>e for synchronous and <a href="https://developer.mozilla.org/en-US/docs/Web/API/Navigator/sendBeacon">sendBeaco</a>n in <a href="https://gist.github.com/Beraliv/92a80cd531cd8e0535f7fabd05fda88d#file-vendor-videojs-js-L11099">_clearBeaconQueue</a> for asynchronous requests. The data is sent as a sequence of events.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/710/1*uxxqfvrf_STROyzwE24ZPw.png" /></figure><p>The full XMLHttpRequest example is available <a href="https://gist.github.com/Beraliv/fe146fdaf7b87c141ddaf5da10779fda">here</a>. You can see UTC timestamp as uti, event name as e, video id as vid, etc. The events are send to https://&lt;ake&gt;.litix.io where &lt;ake&gt; is user id. The beaconUrl is <a href="https://vfq2nsli1v76fglgdl9puq0cd.litix.io/">https://vfq2nsli1v76fglgdl9puq0cd.litix.io</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*oufvQTyDSwcw-wxO9EPQ8A.png" /></figure><p>The full sendBeacon example is available <a href="https://gist.github.com/Beraliv/2b5e7383bf339e04cd004d99096cf81f">here</a>. You can see more data about browser, OS, libraries, content, course and so on and so forth. The beaconUrl here is <a href="https://vfq2nsli1v76fglgdl9puq0cd.litix.io/">https://vfq2nsli1v76fglgdl9puq0cd.litix.io</a> as well.</p><h3>DRM</h3><p>All my old courses’ videos(and even the one I purchased now) are MP4. I didn’t find anything that includes <a href="https://developer.mozilla.org/en-US/docs/Plugins/Flash_to_HTML5/Video/DRM_and_authentication">DRM</a>. However, the url to the stream includes 2 GET-parameters to have access to it: nva and token, otherwise access is forbidden.</p><p>Video tag element contains the source to the stream and plays it just fine. If you try to put src without those parameters, you will get the error:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tWKyiNLZIoHzN-VRNhYTdg.png" /></figure><p>Alexey Berezin,<br>Front-end Developer from <a href="https://yandex.ru/company/">Yandex</a></p><p><a href="https://www.linkedin.com/in/beraliv/">LinkedIn</a><br><a href="https://github.com/Beraliv">GitHub</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=82a21387133a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[BBC iPlayer geolocation identification]]></title>
            <link>https://beraliv.medium.com/bbc-iplayer-geolocation-identification-636830e720d0?source=rss-5e027945073e------2</link>
            <guid isPermaLink="false">https://medium.com/p/636830e720d0</guid>
            <category><![CDATA[bbc]]></category>
            <category><![CDATA[react]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[iplayer]]></category>
            <category><![CDATA[identification]]></category>
            <dc:creator><![CDATA[Alexey Berezin]]></dc:creator>
            <pubDate>Sun, 22 Dec 2019 18:10:29 GMT</pubDate>
            <atom:updated>2019-12-22T18:10:29.555Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*H2LAQiocbOhk6Wslb6zKKQ.png" /></figure><p>Developing video player in Yandex, I’m not always limited to what we do but also wondering what technologies and techniques are used in other companies. As I like England I investigated the player of BBC, well-known quite a big company. Unfortunately I haven’t used it before, but maybe this is why I’m going to tell you how it’s working.</p><h3>Watch the content from non-UK</h3><p>iPlayer is working only in the UK. After going to <a href="https://www.bbc.co.uk/iplayer/episode/m000cfsk/the-graham-norton-show-series-26-episode-12">The Graham Norton Show</a> you’ll see this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CnFQkgJ1HOP653KN2TuXYg.png" /></figure><p>VPN, incognito window or other simple hacks are just not working. Even in 2014 <a href="https://www.digitalelement.com/bbc-deploys-digital-elements-ip-geolocation-technology-to-manage-online-content-rights/">BBC configured Geolocation technology to manage online content rights</a>.</p><h3>How BBC identifies you</h3><p>First of all, to understand how it’s working we need to find where country identification is placed.</p><p>If you go to HTML source, you’ll see <a href="https://gist.github.com/Beraliv/158cc85b53277a332d7298a7563266c4">inline script</a> in it:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yr4mCtU8J7H7uj7GASZOig.png" /></figure><p>Let’s go through it to get a general idea of what is going on here:</p><ol><li>First, user profile <a href="https://gist.github.com/Beraliv/158cc85b53277a332d7298a7563266c4#file-bbcuser-js-L4">is initialised</a></li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1oRm5ltSswM9TQza5yLmaw.png" /></figure><p>2. Then many auxiliary functions are declared, skip them for now</p><p>3. <a href="https://gist.github.com/Beraliv/158cc85b53277a332d7298a7563266c4#file-bbcuser-js-L97">User API is declared</a> in window.bbcuser, some of the functions use getUserInfo</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/972/1*9r1OB7PnAe6ZxTpx6Ldgrw.png" /></figure><p>4. getUserInfo <a href="https://gist.github.com/Beraliv/158cc85b53277a332d7298a7563266c4#file-bbcuser-js-L71">checks</a> if data is saved or not:</p><ul><li>If <a href="https://gist.github.com/Beraliv/158cc85b53277a332d7298a7563266c4#file-bbcuser-js-L76">saved</a>, data is used from the closure</li><li>If fetch and CORS-requests are allowed, GET-request is initiated from the user profile (for <a href="http://bbc.co.uk/">bbc.co.uk</a> it is <a href="https://www.bbc.co.uk/userinfo">https://www.bbc.co.uk/userinfo</a>), after first time the response is cached. The response looks like:</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*L0Sm5DU_QXe18ODcsNRpgA.png" /></figure><ul><li>Otherwise, there’s a <a href="https://gist.github.com/Beraliv/158cc85b53277a332d7298a7563266c4#file-bbcuser-js-L46">fallback function</a> which loads module orb/fig with _figManager.js . It uses microservice which is available on <a href="https://fig.bbc.co.uk/frameworks/fig/2/fig.js">https://fig.bbc.co.uk/frameworks/fig/2/fig.js</a> and returns a code which is executed later on. The most interest part here is a parameter uk — it equals 1 if the request has been sent from the UK, otherwise 0.</li><li>If the request hasn’t been sent from the UK, watching is prohibited due to rights issues.</li><li>As I investigated iPlayer from Russia, it returned 0 and the content wasn’t available. The response was:</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/796/1*Nrb6udse9QuRGafb0YukIQ.png" /></figure><p>5. At the end of HTML there a script which calls isUKCombined, it uses API that I described above, saving my profile to a variable <a href="https://gist.github.com/Beraliv/158cc85b53277a332d7298a7563266c4#file-bbcuser-js-L24">user</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NXCEHeTYri7Zm5dpkWtLCg.png" /></figure><p>6. Script with id=&#39;tvip-script-app-store&#39; is inlined in HTML closer to the end of HTML and includes <a href="https://gist.github.com/Beraliv/f1261bef7701af494fa9b9546032fd5e">initial Redux state</a>. You can find the flag <a href="https://gist.github.com/Beraliv/f1261bef7701af494fa9b9546032fd5e#file-tvip-script-app-store-js-L369">isForeignRegion</a> which is null by default.</p><p>7. When app.bundle.js is loaded, componentDidMound checks that isUK is not 0. As it’s 0, it calls callback function onUserForeignRegion</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WZiI-9YVivH89HKdsOBw3A.png" /></figure><p>8. It updates store value of isForeignRegion</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UxEJbEyCjPObnOnb_Y3CAg.png" /><figcaption>the reducer for <strong>user</strong></figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*eEPvFFHlSJXZoAAqxzmd-w.png" /><figcaption>the action to set foreign region value</figcaption></figure><p>9. It forces React.component with possible name ForeignRegionBanner to rerender (at least one prop was changed)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Ydr1QDMj5d22naK-azG9MQ.png" /></figure><p>10. And finally you can see the warning message on the page</p><p>Alexey Berezin,<br>Front-end Developer from <a href="https://yandex.ru/company/">Yandex</a></p><p><a href="https://www.linkedin.com/in/beraliv/">LinkedIn</a><br><a href="https://github.com/Beraliv">GitHub</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=636830e720d0" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Amazon Prime Video Player Investigation]]></title>
            <link>https://beraliv.medium.com/amazon-prime-video-player-investigation-8fa2dc68779d?source=rss-5e027945073e------2</link>
            <guid isPermaLink="false">https://medium.com/p/8fa2dc68779d</guid>
            <category><![CDATA[video-development]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[video-player]]></category>
            <dc:creator><![CDATA[Alexey Berezin]]></dc:creator>
            <pubDate>Mon, 16 Dec 2019 23:12:56 GMT</pubDate>
            <atom:updated>2019-12-16T23:12:56.017Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rt-hHy2nZhqtLzuZoGppFg.png" /></figure><p>Today I had an hour of my free time to learn how Amazon Prime Video Player is working. I’ll show you my small investigation of what I found.</p><h3>Where is the main script</h3><p>Playing and pausing is the core functionality of the player. Therefore it’s easy to get where the main script is situated by doing the following:</p><ol><li>Pause the player</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TRLdlrUPz_poOcPx2KKmJw.png" /><figcaption>Amazon Video Player which is paused at the moment</figcaption></figure><p>2. Find&lt;video&gt; tag in DevTools &gt; Elements</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WgZhuHJicdh54SGfBCCoQQ.png" /><figcaption>It could be 2 video elements, you need the one which is both 100% width and height</figcaption></figure><p>3. You need DevTools &gt; Console to mock standard play method having current video— $0.play = () =&gt; { debugger; }</p><p>4. Then you try to play video using player controls</p><p>5. Having Call Stack you can go to the file, which initiated a method play</p><p>6. You now know the main script name, which Amazon Prime pointed at the moment of the debugging to blob:<a href="https://www.amazon.com/1a511ffb-e998-43b9-be96-51b11a55ab37:formatted">https://www.amazon.com/1a511ffb-e998-43b9-be96-51b11a55ab37</a>, you can see it in Sources &gt; Page</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wzvPVEyt16--pSYsy5qCOw.png" /></figure><h3>What can you find interesting inside the script</h3><h3>Private properties</h3><p>In comparison to Google and <a href="https://developers.google.com/closure/compiler">Closure Compiler</a>, Amazon Player developers do NOT minify private properties, which is why everybody can read most of the script code without problem, even if you don’t have <a href="https://developer.mozilla.org/en-US/docs/Tools/Debugger/How_to/Use_a_source_map">Source Maps</a>.</p><h3>State Machine</h3><p>You can also find this.stateMachine, this means that all the states and transitions between them are declared inside, not all transitions are allowed though. Anyway it’s better for controlling, testing and debugging (at least better than having a lot of flags with names like isPlaying, isPause etc.)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*I5UXo4azLsRIm-ZA_NufxA.png" /><figcaption>Key is the <strong>current state</strong>, values are the <strong>states which are available</strong> for the current state <strong>to have a transition to</strong></figcaption></figure><h3>Loading a bundle</h3><p>If you reload the page several times, you can see that a bundle <strong>blob:</strong><a href="https://www.amazon.com/1a511ffb-e998-43b9-be96-51b11a55ab37:formatted"><strong>https://www.amazon.com/</strong></a><strong>xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx</strong> has different names. It means there is a loader where you can find a way to load the script with different names. In DevTools &gt; Network you can see Initiator and go from file to file:</p><ul><li>ATVWebPlayer.js— <a href="https://js-assets.aiv-cdn.net/playback/web_player/ATVWebPlayer/1.0.200751.0/js/ATVWebPlayer.js:formatted">https://js-assets.aiv-cdn.net/playback/web_player/ATVWebPlayer/1.0.200751.0/js/ATVWebPlayer.js:formatted</a></li><li>WebLoader.js — <a href="https://js-assets.aiv-cdn.net/playback/web_player/WebLoader.js:formatted">https://js-assets.aiv-cdn.net/playback/web_player/WebLoader.js:formatted</a></li><li>Inlined script which is added with type application/json and has an id — av-wconf-dv-web-player-cfg, which has a link to a loader</li></ul><p>In WebLoader there is hardcoded AppLoaderConfig. After reloading several times I couldn’t find a difference. Looks like config of stable version of modules which are used for different purposes. The config looks like that:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/978/1*iGSZK-JUilSIafr-jKHFsA.png" /><figcaption>Configuration object within <strong>WebLoader.js</strong></figcaption></figure><p>A bundle which we had a look into was loaded from ATVWebPlayer.js as a string of 6MB size!!! The string is taken from <a href="https://developer.mozilla.org/en-US/docs/Web/API/IndexedDB_API">IndexedDB</a>. The object after completed transaction is the following:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wnVCvjJgN8yVSRyWk2PPOg.png" /></figure><p>From the given string we can create a Blob, create object url as a script:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZJgXabCqSgFp0yUofVCRpQ.png" /></figure><p>And we come back to the script which code initiated play when we debugged it in the first section. The name of the module is ATVWebCascadesPlayer</p><p>Alexey Berezin,<br>Front-end Developer from <a href="https://yandex.ru/company/">Yandex</a></p><p><a href="https://www.linkedin.com/in/beraliv/">LinkedIn</a><br><a href="https://github.com/Beraliv">GitHub</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8fa2dc68779d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[ Transducers API Introduction]]></title>
            <link>https://beraliv.medium.com/transducers-api-introduction-a61b5b40fcaa?source=rss-5e027945073e------2</link>
            <guid isPermaLink="false">https://medium.com/p/a61b5b40fcaa</guid>
            <category><![CDATA[nano]]></category>
            <category><![CDATA[transducers]]></category>
            <category><![CDATA[functional-programming]]></category>
            <category><![CDATA[nanoutils]]></category>
            <category><![CDATA[javascript]]></category>
            <dc:creator><![CDATA[Alexey Berezin]]></dc:creator>
            <pubDate>Sun, 03 Feb 2019 20:29:28 GMT</pubDate>
            <atom:updated>2019-02-03T20:36:07.010Z</atom:updated>
            <content:encoded><![CDATA[<h3>🚀 Transducers with nanoutils 0.1.1</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GunZhAWNQKT87tX-JipdOg.png" /></figure><h3>What’s a transducer?</h3><p>Transducer is a function which changes behaviour of a reducer without knowing the structure and without creating intermediate structures</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Ay8BA-8vpJq5JFoOHJY_Qw.gif" /><figcaption>Transformation process using transducers. Mentioned in <a href="https://medium.com/@roman01la/understanding-transducers-in-javascript-3500d3bd9624">Understanding Transducers in JavaScript</a>.</figcaption></figure><h3>Examples</h3><p><strong>Task</strong>. Find sum of all ages which will be even next year<br><strong>Means</strong>. You can do it at least three different ways</p><h4>Imperative style</h4><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/9ead65eb0f9b75bdebc5da93882e8d2e/href">https://medium.com/media/9ead65eb0f9b75bdebc5da93882e8d2e/href</a></iframe><h4>Declarative way with Array.prototype methods</h4><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/0f3fe7c32416eb66313d685c92dee43c/href">https://medium.com/media/0f3fe7c32416eb66313d685c92dee43c/href</a></iframe><p>I know here you can only use reduce but it becomes imperative and loses effect of <a href="https://en.wikipedia.org/wiki/Divide-and-conquer_algorithm">Divide and Conquer</a>. Here it means all steps are separated from each other and easily readable</p><h4>Declarative way with transducers</h4><p>Here we use nanoutils@0.1.1</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/7101e1794128cae9c9e88364d8c1e262/href">https://medium.com/media/7101e1794128cae9c9e88364d8c1e262/href</a></iframe><p>Here I intentionally didn’t write it in a single line as it doesn’t improve performance and makes it clear</p><h3>Performance 🐌 … 🚀</h3><p><a href="https://medium.com/@beraliv/nanoutils-0-1-0-3d27f62e8856">Performance test</a> was implemented with perf_hooks</p><p>Given 3 ways mentioned above for array of sizes 10K, 100K and 1M the statistics look like this</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6QfAOfuO2rJhmxHdvT4q-g.png" /></figure><p>You can check performance on <a href="https://codesandbox.io/s/xp56wvl81o">CodeSandbox</a></p><h3>Yet another one example</h3><p><strong>Task</strong>. Having posts on the page return first page (to make example even more simple) which is filtered by a specified author and date<br><strong>Input.</strong> All data was generated with <a href="https://github.com/Marak/faker.js">Fake</a>. Example is available in <a href="https://codesandbox.io/s/jv10xj8woy">CodeSandbox</a></p><h4>Imperative style</h4><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/fb31c3b5840e819defec970071247447/href">https://medium.com/media/fb31c3b5840e819defec970071247447/href</a></iframe><p>The code itself can be optimised. However, every step is described in details. The bad part here is that we need to provide next filter with one more function which is bad for scalability</p><h4>Declarative way with Array.prototype methods</h4><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/f5caa088306aa8ba0ee79d6011cb5583/href">https://medium.com/media/f5caa088306aa8ba0ee79d6011cb5583/href</a></iframe><p>Here we optimise filters with Object and Array.prototype.every which looks much better. Array.prototype.slice is applicable to get the first filtered value as Array (in case we need 5 or 10 first filtered values)</p><h4>Declarative way with transducers</h4><p>Here we can see several changes</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/312a74d657aa0dbfe97ac343e56e3ed7/href">https://medium.com/media/312a74d657aa0dbfe97ac343e56e3ed7/href</a></iframe><ol><li>filterPredicates — Object which has same structure as post inside posts</li><li><a href="https://nanoutils.github.io/docs/methods.html#where">where</a> is used to validate post with specified filterPredicates</li><li>takeT is used to take first post (if we wanted to take last posts, we would replace transduce =&gt; transduceRight and takeT =&gt; takeLastT)</li><li>pushReducer replaces flip(append) as it creates less Arrays to get the result (To prove it, you can save [] to the variable and mutate it afterwards, you will see that result of transduce is also mutated)</li></ol><h3>Easy to debug</h3><p>If you have troubles you can easily find the way with consoleT or can debug the application easily as nanoutils doesn’t mutate anything</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/2f84bed5f58300ec34b0b0ceb8302481/href">https://medium.com/media/2f84bed5f58300ec34b0b0ceb8302481/href</a></iframe><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/c83fdb2fc168999a2450d5ee9613d40e/href">https://medium.com/media/c83fdb2fc168999a2450d5ee9613d40e/href</a></iframe><h3>Links</h3><ol><li><a href="https://medium.com/@beraliv/nanoutils-0-1-0-3d27f62e8856">Nanoutils 0.1.0: Release</a></li><li><a href="https://github.com/nanoutils/nanoutils/issues/178">Transducer API in details: Issue on GitHub</a></li><li><a href="https://medium.com/@roman01la">Roman Liutikov</a>: <a href="https://medium.com/@roman01la/understanding-transducers-in-javascript-3500d3bd9624">Understanding transducers in Javascript</a></li><li><a href="https://codesandbox.io/docs">CodeSandbox: Documentation</a></li><li><a href="https://nodejs.org/api/perf_hooks.html">Node.js 11.9: Performance Timing API</a></li></ol><p>Thank you!</p><p>Alexey Berezin,<br>Front-end Developer from <a href="https://yandex.ru/company/">Yandex</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a61b5b40fcaa" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[ nanoutils 0.1.0 ]]></title>
            <link>https://beraliv.medium.com/nanoutils-0-1-0-3d27f62e8856?source=rss-5e027945073e------2</link>
            <guid isPermaLink="false">https://medium.com/p/3d27f62e8856</guid>
            <category><![CDATA[nanoutils]]></category>
            <category><![CDATA[functional-programming]]></category>
            <category><![CDATA[nano]]></category>
            <category><![CDATA[utilities]]></category>
            <category><![CDATA[javascript]]></category>
            <dc:creator><![CDATA[Alexey Berezin]]></dc:creator>
            <pubDate>Mon, 14 Jan 2019 21:34:08 GMT</pubDate>
            <atom:updated>2019-01-15T17:46:38.377Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*K40MLP0HRlij7lLfZSYaxw.png" /><figcaption>Logo is designed by <a href="https://twitter.com/philmurph3">Phil Murphy</a></figcaption></figure><h3>What’s nanoutils?</h3><p>🌊 Tiniest FP-friendly JavaScript utils library</p><p>It was created after <a href="https://lodash.com/">Lodash</a> and <a href="https://ramdajs.com/">Ramda</a> but the challenge was to have each method less than 1KB.</p><p>The basic ideas of nanoutils:</p><ol><li>Functional programming is awesome 🔥</li><li>No dependencies ❌</li><li>No ES6 features ❌</li><li>Efficient ⚡🚀</li><li>Light 🎈</li></ol><h3>Awesome size 📦</h3><p>Size is important as download time depends on it</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MvdvFZaRnioTqAbpYbREUg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WHFiNh-g_gzCXsN9FFdeRg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KnM-g3kABK2tqfTWCuLdQg.png" /><figcaption><a href="https://bundlephobia.com/result?p=nanoutils@0.1.0">nanoutils</a> size in comparison with <a href="https://bundlephobia.com/result?p=ramda@0.26.1">ramda</a> and <a href="https://bundlephobia.com/result?p=lodash@4.17.11">lodash</a></figcaption></figure><p>nanoutils uses <a href="https://github.com/nanoutils/nanoutils/blob/master/SIZES.md">SIZES.md</a> to check its size.</p><p>We use library <a href="https://www.npmjs.com/package/size-limit">size-limit</a> by <a href="https://twitter.com/sitnikcode">Andrey Sitnik</a>. We have custom <a href="https://github.com/nanoutils/nanoutils/blob/master/misc/cli/size.js">CLI</a> which can write data to terminal and saves all information to Markdown file.</p><p>According to recently added <a href="https://github.com/nanoutils/nanoutils/commit/022172a0305c85a442477cee1472334d8dc40087">statistics</a>:</p><ul><li>Average nanoutils method is ~700B lighter than ramda’s</li><li>50% of nanoutils methods are less than ~110B while ramda has its median around ~470B</li><li>maximum method size for nanoutils is within 1KB and equals 674B while ramda doesn’t limit its size and its largest method equals ~3400B</li></ul><p>Based on <a href="https://bundlephobia.com/">BundlePhobia</a>:</p><ul><li>nanoutils is tree-shakeable as ramda</li><li>nanoutils takes 100ms and 500ms less time to be downloaded in comparison with ramda and lodash respectively</li></ul><h3>Performance</h3><p>Performance is difficult to compare as time is different for different devices.</p><p>nanoutils uses <a href="https://github.com/nanoutils/nanoutils/blob/master/TIMES.md">TIMES.md</a> to check its performance time</p><p>We use approach with <a href="https://nodejs.org/api/perf_hooks.html">Performance Timing API</a>. We have custom <a href="https://github.com/nanoutils/nanoutils/blob/master/misc/cli/time.js">CLI</a> as well with bunch of functions and <a href="https://github.com/nanoutils/nanoutils/blob/master/lib/_internal/helpers/performance.js">helpers</a> which combine data and compare it based on several runs. For some methods performance tests (i.e. <a href="https://github.com/nanoutils/nanoutils/blob/master/lib/ap/ap.performance.js">ap.performance.js</a>) are written where data is cached in <a href="https://github.com/nanoutils/nanoutils/tree/master/misc/cache">JSON files</a>.</p><p>Now not all methods are covered with performance tests. It will be done in future releases.</p><h3>Roadmap</h3><p><strong>0.1.1 </strong><a href="https://github.com/nanoutils/nanoutils/issues/178">Transducers API</a> introduction<strong><br>0.2.0</strong> <a href="https://github.com/nanoutils/nanoutils/issues/183">Performance tests</a> coverage<br>0.3.0 TS coverage</p><h3>Team</h3><ol><li>Idea of the project — <a href="https://medium.com/u/7d8e23d71c9d">Anton Kosykh</a></li><li>Size compressor of the project — <a href="https://medium.com/u/5e027945073e">Alexey Berezin</a></li><li>Performance accelerator of the project — <a href="https://medium.com/u/8397cb89d58b">Aleksandr Babkin</a></li><li>Designer of the logo — <a href="https://medium.com/u/87a17e2d83e4">Phil Murphy</a></li></ol><h3>Links</h3><ol><li><a href="https://github.com/nanoutils/nanoutils">Github</a></li><li><a href="https://www.npmjs.com/package/nanoutils">Npm</a></li><li><a href="https://nanoutils.github.io/">Docs</a></li></ol><p>Thank you!</p><p>Alexey Berezin,<br>Front-end Developer from <a href="https://yandex.ru/company/">Yandex</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3d27f62e8856" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How I configured one website]]></title>
            <link>https://beraliv.medium.com/how-i-configured-one-website-28dae9eda50?source=rss-5e027945073e------2</link>
            <guid isPermaLink="false">https://medium.com/p/28dae9eda50</guid>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[ux]]></category>
            <category><![CDATA[configuration]]></category>
            <category><![CDATA[cms]]></category>
            <category><![CDATA[improvement]]></category>
            <dc:creator><![CDATA[Alexey Berezin]]></dc:creator>
            <pubDate>Fri, 09 Nov 2018 23:57:13 GMT</pubDate>
            <atom:updated>2018-11-10T06:56:43.103Z</atom:updated>
            <content:encoded><![CDATA[<h3>Introduction</h3><p>One Saturday afternoon I started researching top 20 of <a href="https://twitter.com/WTA">@WTA</a> players&#39; site structure, its performance and tried to come up with something better (image loading, adaptive layout, etc)</p><p>And it turned out most of websites use Wordpress?!</p><h3>Alexey Berezin on Twitter</h3><p>7. I was also impressed with the fact most of websites use @WordPress for some reason. It&#39;s not convenient, very heavy and kind of deprecated. I would better suggest @TildaPublishing. I&#39;ve also heard of @squarespace which looks amazing, but better research first.</p><p>I researched analogues and found more appropriate CMS for myself and it was <a href="https://medium.com/u/5250f9d9bd2f">Netlify</a> CMS. I found <a href="https://github.com/Jinksi/netlify-cms-react-starter">netlify-cms-react-starter</a> of <a href="https://medium.com/u/3e79cd79020b">Jinksi</a> on <a href="https://medium.com/u/8df3bf3c40ae">GitHub</a>, forked it and started to change it</p><h3>Usability</h3><p>As for me, very configurable and easy way to understand as a frontend developer. It stores all pages as Yaml or Markdown, saves all images in a Github repo, deploys on every commit hook</p><p>I’ve created webpage <a href="https://tda-mz.netlify.com/">https://tda-mz.netlify.com</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2Hwtfqtfjt5eTz-Z24nCKg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7EUYelDqNyMlBbpocRInog.png" /><figcaption>Main page</figcaption></figure><p>CMS also has admin page where all can be changed quickly</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*noj3ui-Ii5Z2ZCUxBcEQWg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ALGCfnngTsdyKaeNBSkbog.png" /><figcaption>Log in to admin page</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HUuCmAyboM4nfnAX_8eODA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HedDvWRJdzbUiJk-SYyhXg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CrQyzS3caAte3grsVj-ZsQ.png" /><figcaption>Edit pages with different content</figcaption></figure><p>It uses React to write components. In <a href="https://medium.com/u/3e79cd79020b">Jinksi</a>’s repo there were already a number of custom components which I extended</p><h3>Customisation</h3><p>First, I filled pages with the content using CMS</p><p>Next, I used Lighthouse to check metrics of web pages</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ojudNePB4C1lGPCfClZ5vg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LJWlJegJw4_awRCeMyY5gQ.png" /></figure><p>It wasn’t good at first, but step by step I improved it</p><h4>Performance</h4><p>I needed to lazy load images as they slow down UX. It includes <a href="https://github.com/Beraliv/tda-mz-netlify-cms/commit/cfe11a55e1b79220b6eed8fe06e08e2f80780603#diff-99d4f6b80f3d5eca79161bb00f95dee4R45">Gallery component</a> which I added and <a href="https://github.com/Beraliv/tda-mz-netlify-cms/commit/893bc661cab8024ee4de72efaca914f42577bd4b">background images</a>. It then started to load faster even for mobile devices with poor Internet connection</p><h4>PWA</h4><p>I added <a href="https://github.com/Beraliv/tda-mz-netlify-cms/commit/9e3455932c0ca6116268ef15d2fd10115a92a90d#diff-688128be216cc2f753fe641590f2fcd3R17">manifest</a>, <a href="https://github.com/Beraliv/tda-mz-netlify-cms/commit/6d5fb941b20dede8cac42da3beb506a2545fc34b">updated logos with description in manifest</a> and now Android application is available via Chrome</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SGG1BiFzQpJanY-gk2pOrg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BDWX3uymRd7fZamcniPkqQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rI3FQRCk6ubxzwJkhMfMug.png" /><figcaption>Chrome &gt; Add &gt; Open</figcaption></figure><p>It’s available on desktop using Chrome as well</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FdZ1Fw_fONZ0mShypcJ57w.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zAGJLFPlMNiQjpkyCFCnxw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5tUYtXziF9wdmeTuK-VVSg.png" /><figcaption>Settings &gt; Install &gt; Open</figcaption></figure><p>Moreover, all content is cached. This means it loads pages faster next time!</p><h4>Accessibility</h4><p>To make web application accessible via screen readers, I fixed issues which were <a href="https://github.com/Beraliv/tda-mz-netlify-cms/commit/3592e5ff157545de5e8549b854a25e3c04d1c24c">advised by Lighthouse</a>. There are aria-label, alt, rel and some meta tags. It was fixed for <a href="https://github.com/Beraliv/tda-mz-netlify-cms/commit/eb36035936469a35d252bbe87510d3d0e4b03054#diff-edf0a949b3710ea23cd656f8338771a5R75">social media links</a>, forms, buttons, etc</p><h3>Conclusion</h3><p>After optimisation, the metrics look like that:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*e6cNETCwK2sw9x4FYZe4Iw.png" /><figcaption>Main page</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1zSkfpQX1kQm0bbpAk7huA.png" /><figcaption>Gallery page with carousels</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cs4HlXvXNsCoU1oRImwOyg.png" /><figcaption>Benefits page with grid</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zrni4beCupqauGZlrv4ZeQ.png" /><figcaption>Blog and news page</figcaption></figure><p>I’m totally satisfied with it and ready to improve website in any other way</p><p>Alexey Berezin,<br>Graduate student from St Petersburg State University, Master’s<br>Front-end Developer from <a href="https://yandex.ru/company/">Yandex</a></p><p><a href="https://www.linkedin.com/in/beraliv/">LinkedIn</a><br><a href="https://github.com/Beraliv">GitHub</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=28dae9eda50" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Scrollbar customisation]]></title>
            <link>https://beraliv.medium.com/scrollbar-customisation-31bd28652e9?source=rss-5e027945073e------2</link>
            <guid isPermaLink="false">https://medium.com/p/31bd28652e9</guid>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[web]]></category>
            <category><![CDATA[scrollbar]]></category>
            <category><![CDATA[js]]></category>
            <category><![CDATA[customisation]]></category>
            <dc:creator><![CDATA[Alexey Berezin]]></dc:creator>
            <pubDate>Thu, 04 Oct 2018 00:32:19 GMT</pubDate>
            <atom:updated>2024-05-31T21:25:43.260Z</atom:updated>
            <content:encoded><![CDATA[<h3>Scrollbar customisation (2018 Update)</h3><p>One day some designers provide you with beautiful mock-ups 🌠 and … custom macOS-like scrollbars which look like:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*l75f7mtRAJCSlGBU6uQk4Q.png" /></figure><p>But maybe on the left, smaller or bigger, with different indents dependent on whether it’s mobile 📱, desktop 🖥️ or TV screen 📺 Asking more?</p><p>But the reality is… a customisation of scrollbars remains same since the end of 90s. If my dad was programming, he would make fun of me all day while I found the solution to make everything universal and stable. <a href="https://stackoverflow.com/a/6165489/3745332">It’s 2020 and it’s still a PITA</a>.</p><p>Full article is currently available on <a href="https://blog.beraliv.dev/2018-10-04-scrollbar-customisation/">https://blog.beraliv.dev/2018-10-04-scrollbar-customisation/</a> 🚀🚀🚀</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=31bd28652e9" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to replace email for GitHub history]]></title>
            <link>https://beraliv.medium.com/how-to-replace-email-for-github-history-391391c38db8?source=rss-5e027945073e------2</link>
            <guid isPermaLink="false">https://medium.com/p/391391c38db8</guid>
            <category><![CDATA[git]]></category>
            <category><![CDATA[github]]></category>
            <category><![CDATA[email]]></category>
            <category><![CDATA[history]]></category>
            <dc:creator><![CDATA[Alexey Berezin]]></dc:creator>
            <pubDate>Sat, 29 Sep 2018 12:21:16 GMT</pubDate>
            <atom:updated>2018-10-17T20:33:54.224Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WuBDrfsCFndspAE0r1o2fw.png" /></figure><blockquote>Probably you also forgot to replace your old mail with the new one. Or commited and pushed the code from your working laptop. It’s totally fine, you’re not alone.</blockquote><h3>Here are the steps to fix your problem.</h3><ol><li>Get the repo:</li></ol><pre>git clone --bare <a href="https://github.com/repo.git">https://github.com/repo.git</a></pre><p>2. Create a script file:</p><pre>touch .sh</pre><p>3. Fill the file with the content:</p><pre>#!/bin/sh</pre><pre>git filter-branch --env-filter &#39;<br>OLD_EMAIL=&quot;<a href="/service/mailto:your-old-email@example.com">your-old-email@example.com</a>&quot;<br>CORRECT_NAME=&quot;Your Correct Github username, i.e. <a href="https://github.com/beraliv">BerAlIv</a>&quot;<br>CORRECT_EMAIL=&quot;<a href="/service/mailto:your-correct-email@example.com">your-correct-email@example.com</a>&quot;<br>if [ &quot;$GIT_COMMITTER_EMAIL&quot; = &quot;$OLD_EMAIL&quot; ]<br>then<br>    export GIT_COMMITTER_NAME=&quot;$CORRECT_NAME&quot;<br>    export GIT_COMMITTER_EMAIL=&quot;$CORRECT_EMAIL&quot;<br>fi<br>if [ &quot;$GIT_AUTHOR_EMAIL&quot; = &quot;$OLD_EMAIL&quot; ]<br>then<br>    export GIT_AUTHOR_NAME=&quot;$CORRECT_NAME&quot;<br>    export GIT_AUTHOR_EMAIL=&quot;$CORRECT_EMAIL&quot;<br>fi<br>&#39; --tag-name-filter cat -- --branches --tags</pre><p>You can also change conditions to:</p><pre>if [ &quot;$GIT_COMMITTER_EMAIL&quot; = &quot;$OLD_EMAIL&quot; ] || [ &quot;$GIT_COMMITTER_NAME&quot; = &quot;$OLD_NAME&quot; ]<br>then<br>    export GIT_COMMITTER_NAME=&quot;$CORRECT_NAME&quot;<br>    export GIT_COMMITTER_EMAIL=&quot;$CORRECT_EMAIL&quot;<br>fi<br>if [ &quot;$GIT_AUTHOR_EMAIL&quot; = &quot;$OLD_EMAIL&quot; ] || [ &quot;$GIT_AUTHOR_NAME&quot; = &quot;$OLD_NAME&quot; ]<br>then<br>    export GIT_AUTHOR_NAME=&quot;$CORRECT_NAME&quot;<br>    export GIT_AUTHOR_EMAIL=&quot;$CORRECT_EMAIL&quot;<br>fi</pre><p>Do not forget to add OLD_NAME=&quot;your old name, i.e. BerAlIv&quot; before the conditions</p><p>4. Run the script with:</p><pre>sudo sh .sh</pre><p>5. After executing the script you may remove the backup branch by executing:</p><pre>sudo git update-ref -d refs/original/refs/heads/master</pre><p>6. Then, upload all changes and tags using:</p><pre>git push --force --tags origin master</pre><p>7. Pull all changes with histories which were updated on previous steps:</p><pre>git pull origin master --allow-unrelated-histories</pre><p>Thank you for you time!</p><p>Source: <a href="https://stackoverflow.com/questions/750172/how-to-change-the-author-and-committer-name-and-e-mail-of-multiple-commits-in-gi">https://stackoverflow.com/questions/750172/how-to-change-the-author-and-committer-name-and-e-mail-of-multiple-commits-in-gi</a></p><p>Please, <a href="https://medium.com/u/8df3bf3c40ae">GitHub</a>, update <a href="https://help.github.com/articles/changing-author-info/">your docs</a></p><p>Alexey Berezin,<br>Graduate student from St Petersburg State University, Master’s<br>Front-end Developer from <a href="https://yandex.ru/company/">Yandex</a></p><p><a href="https://www.linkedin.com/in/beraliv/">LinkedIn</a><br><a href="https://github.com/Beraliv">GitHub</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=391391c38db8" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>