<?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 Murat Dogan on Medium]]></title>
        <description><![CDATA[Stories by Murat Dogan on Medium]]></description>
        <link>https://medium.com/@muratdogan?source=rss-d58b91e8bb9a------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*OIBgG4aEYnHRpR4KQXkmmA.png</url>
            <title>Stories by Murat Dogan on Medium</title>
            <link>https://medium.com/@muratdogan?source=rss-d58b91e8bb9a------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 22 Nov 2026 18:48:27 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@muratdogan/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[Being a Frontend Developer in the AI world]]></title>
            <link>https://muratdogan.medium.com/being-a-frontend-developer-in-the-ai-world-be2a41db02c5?source=rss-d58b91e8bb9a------2</link>
            <guid isPermaLink="false">https://medium.com/p/be2a41db02c5</guid>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[front-end-development]]></category>
            <dc:creator><![CDATA[Murat Dogan]]></dc:creator>
            <pubDate>Wed, 25 Feb 2026 19:27:54 GMT</pubDate>
            <atom:updated>2026-02-25T19:27:54.555Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*a7l2cRa9Zmc-VyqE" /><figcaption>Photo by Alexander Sinn on Unsplash</figcaption></figure><p>Alright, Frontend Developer! (Let’s call it FE for the rest of the article)</p><p>Rings are belling for you, right? Well, that’s not that true, if you hear them from a different perspective.</p><p>Okay, fellow FE friend. Let me introduce myself to you first before you check my LinkedIn profile and save you a few minutes :) It’s been 17 years since I first wrote my paid code. It was always about the frontend. I have worked in a variety of companies, from startups to large enterprises with over 100k employees. I’ve built FE teams from scratch and managed projects, teams, and deadlines. If you are convinced I’m eligible to have a few words, we can move to the next section.</p><p>It was never just about coding, especially for the fe folks. There has always been something I shared with them: the FE position is at the heart of the organization, not just because we’re super essential or needed, etc. Because in a healthy working environment, as a Fe developer, you should be in touch with many stakeholders.</p><ul><li>You need to stay in touch with the product managers to review the requirements from a technical perspective.</li><li>You need to stay in touch with the designer to determine the technical capabilities.</li><li>You need to stay in touch with the backend developer to agree on the API contract.</li><li>You need to stay in touch with the QA team to ensure the app is working as expected.</li><li>You need to stay in touch with DevOps to ensure your app is deployed and working in production and lower environments.</li><li>Not enough? You need to stay in touch with your Analytics team, your marketing team, and so on.</li></ul><p>There have always been tools to fasten this process. As a developer, I went through all the manual processes and now find myself in this super-fast world, where there are many tools.</p><p>Just a small example; way back in the days, we were writing CSS hacks for Internet Explorer 6/7/8 visibility issues. (Okay boomer!) Then the new engines arrived and made the need for those hacks obsolete!</p><p>Of course, we cannot match the AI capabilities with the tools we previously built, but the mentality is the same.</p><p>The first rule is accepting the change. Then learn. Then adapt. Then apply. Don’t forget this circle.</p><h3>Will AI replace our jobs?</h3><p>It depends on how you see it. Yeah, it has already replaced my job while I’m writing repetitive conditions, it has already replaced my job while writing PR descriptions, it has already replaced my job with the documentation.</p><p>Did it really replace me, or did it change the way I worked previously?</p><p>If you could find the answer to this, you’d have the remaining path for the rest of your career, BUT, just for now. Keep learning, keep evolving. That’s the tricky part of this job :)</p><p>P.S. Not a single word of this article was written by AI</p><p>All the best</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=be2a41db02c5" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Chrome tarayıcıda farklı bir TimeZone’u nasıl simüle ederim?]]></title>
            <link>https://muratdogan.medium.com/chrome-taray%C4%B1c%C4%B1da-farkl%C4%B1-bir-timezoneu-nas%C4%B1l-sim%C3%BCle-ederim-161dfc48e70c?source=rss-d58b91e8bb9a------2</link>
            <guid isPermaLink="false">https://medium.com/p/161dfc48e70c</guid>
            <category><![CDATA[chrome]]></category>
            <category><![CDATA[debugging]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[development]]></category>
            <category><![CDATA[timezone]]></category>
            <dc:creator><![CDATA[Murat Dogan]]></dc:creator>
            <pubDate>Tue, 20 Aug 2024 11:04:19 GMT</pubDate>
            <atom:updated>2024-08-20T11:04:19.207Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*vYNeuL2vF95v14TU" /><figcaption>Credit: <a href="https://unsplash.com/photos/photo-of-outer-space-Q1p7bh3SHj8">Unsplash</a></figcaption></figure><p>Sakin bir iş günüydü. Her şey yolunda giderken iletilen bir bug ile ortalık biraz hareketlendi. Dünyanın bu tarafında gayet güzel çalışan web uygulamamızın, Amerikadaki kullanıcılar tarafından sorunla karşılaşıldığı bilgisi geldi.</p><p>Bir sorunla uğraşırken, eğer o sorunu kendi bilgisayarınızda ya da en azından ekip arkadaşlarınızın bilgisayarında canlandıramazsanız vay halinize! Çünkü çözmek için sadece geçmişe dönük teorileriniz oluyor. Bir şey deniyorsunuz, oluşan linki sorun yaşayan kişiye iletebiliyorsanız ne mutlu, iletemediğinizde ya da o sorun yaşanmaya devam ettiğindeki hayal kırıklığı ise anlatılmaz yaşanır.</p><p>Benzer bir durumdayım, kafamda bir kaç teori var ve hemen başlıyorum bir şeyler üretmeye. Allahtan sorunu yaşayan kişi US ekibinden biri. O uyanana kadar ben test linklerini hazır ediyorum ki; o uyanacak, test edecek ve çözülmüş diyecek. Ben de kodu canlıya alacağım. Bu sefer kazın ayağı öyle olmuyor. :) Bir çok git gel yaşıyoruz karşı tarafla. Ona nasıl test edeceğini, hatta benim için nasıl debug edeceğini adım adım anlatıyorum çünkü teknik biri değil kendisi CS ekibinden.</p><p>Çeşitli denemelerden sonra, sorunun date ve timezone kaynaklı olduğundan 100% emin oldum. Bu noktada artık karşı tarafı da daha fazla darlamak istemedim ve bir çözüm arayışına gittim. Eskilerde olduğu gibi, Internet Explorer sürümlerini simüle ettiğimiz günleri hatırladım :) Evet, evet, internet explorer 6 diye bir şey vardı bir zamanlar ve biz onu simüle edip ona göre geliştirme yapardık, hey gidi… :) Neyse konumuza dönelim.</p><p>Bir sorunu çözerken yapmanız gereken en önemli şey, sanıyorum herkes katılacaktır, doğru soruyu sormaktır. Sorunu bildirene, kendinize, yeri geldiğinde takımınıza.</p><p>Benim bu timezone olayını simüle etmem gerekiyordu ama öyle kod içerisindeki her yere timezone tanımlamadan. Tarayıcım direkt oradaki bir tarayıcı gibi davranmalıydı. Bu noktadan sonra işler çok kolaylaştı. Ufak bir google araması ile Chrome’un böyle bir özelliği olduğunu öğrendim.</p><p>Peki neden bu kadar uzattım bu konuyu da direkt ekranları göstermedim? Öncelikle buraya kadar okuduysanız teşekkür ederim :) Bazen bana da oluyor, okuduğum teknik bir makaleyi günlük rutinimde bir yere oturtamıyorum. Bazen mesleğe yeni başlayan arkadaşlar sorunlarla karşılaştığında, nasıl bir yol izleyeceklerini bilemeyebiliyorlar. Amacım tüm bu şeyleri kapsamak hepsi bu.</p><p>Gelelim Chrome’un bu gizli hazinesinin nerede saklı olduğuna:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yldhW7CTDO2id9lGA2d1KA.png" /><figcaption>Adım 1</figcaption></figure><p>Öncelikle developer tool açıyoruz ve sağ üst köşesindeki 3 noktaya tıklıyoruz.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/449/1*U9pUWtXKJJTrtFNOgVE1Rg.png" /><figcaption>Adım 2</figcaption></figure><p>Burada sırasıyla more tools &gt; Sensors öğesine tıklıyoruz.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/590/1*3SR9DEvHyelC0uEy8BSzmA.png" /><figcaption>Adım 3</figcaption></figure><p>Açılan ekranda, lokasyon, enlem, boylam vs gibi bir çok ayarı değiştirip simülasyonumuzu başlatabiliyoruz.</p><p>Sıcağı sıcağına başıma gelen bu olayı sizlerle paylaşmak istedim. Umarım işinize yarar. Hepinize sağlıklı ve keyifli günler diliyorum.</p><p>Murat</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=161dfc48e70c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Redux nedir? Nerelerde kullanılır?]]></title>
            <link>https://muratdogan.medium.com/redux-nedir-nerelerde-kullan%C4%B1l%C4%B1r-97536376c340?source=rss-d58b91e8bb9a------2</link>
            <guid isPermaLink="false">https://medium.com/p/97536376c340</guid>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[frontend]]></category>
            <category><![CDATA[react]]></category>
            <category><![CDATA[redux]]></category>
            <category><![CDATA[web]]></category>
            <dc:creator><![CDATA[Murat Dogan]]></dc:creator>
            <pubDate>Mon, 17 Oct 2022 11:04:01 GMT</pubDate>
            <atom:updated>2022-10-17T11:04:01.270Z</atom:updated>
            <content:encoded><![CDATA[<p>Frontend geliştiricilerinin bir çoğunun en çok korktuğu terimlerin başında gelebilir Redux. Hep böyle uzaktan öcü gibi bakılan, sanki öğrenmek asırlar alacak, bir konu öğreneceğiz diye onlarca şeyi nasıl anlayacağız vs diye hep kendinden bariyerli bir öğrenim eğrisi olan konu.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*1-eDQcr6BeHvJuCo" /><figcaption>Redux öğrenmeye çalışan developer, temsili değil! :) Credit: Unsplash</figcaption></figure><p>Uzun zamandır anlatmak istiyordum, sonunda fırsatını buldum. 20 dakikada evrenin sırrını vermesem de bence Redux’ın sırrını veriyorum. Bu video sonunda hiçbir şey olmasa da Redux’ın korktucu olmadığını görmüş olacaksınız.</p><p>Şimdiden iyi seyirler!</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FWIx0DG047rk%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DWIx0DG047rk&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FWIx0DG047rk%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/53ec44b2c927bfb7576b7aa1cacd3a09/href">https://medium.com/media/53ec44b2c927bfb7576b7aa1cacd3a09/href</a></iframe><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=97536376c340" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Gerçek bir projede Micro Frontend]]></title>
            <link>https://muratdogan.medium.com/ger%C3%A7ek-bir-projede-micro-frontend-b36bcc26ea71?source=rss-d58b91e8bb9a------2</link>
            <guid isPermaLink="false">https://medium.com/p/b36bcc26ea71</guid>
            <category><![CDATA[npm]]></category>
            <category><![CDATA[react]]></category>
            <category><![CDATA[front-end-development]]></category>
            <category><![CDATA[micro-frontends]]></category>
            <category><![CDATA[frontend]]></category>
            <dc:creator><![CDATA[Murat Dogan]]></dc:creator>
            <pubDate>Wed, 12 Oct 2022 13:45:11 GMT</pubDate>
            <atom:updated>2022-10-12T13:45:11.627Z</atom:updated>
            <content:encoded><![CDATA[<p>Uzun süre sonra herkese merhaba, uzunca bir süredir içerik üretemesem de aslında aklım, fikrim hep buradaydı. Bugün yazısı kısa videosu bol bir içerik bırakıyorum sizlere.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*hwYPh8t7b-Eqw8bD" /><figcaption>Ben mikro frontendi tuğlalara benzetiyorum :) Credit: Unsplash</figcaption></figure><p>Mevcutta çalıştığım şirkette, micro frontend olarak nasıl bir yaklaşım kullanıyoruz, artıları eksileri tam olarak nedir gibi konularda bir video çektim.</p><p>Video çekim programı ve kullandığım mikrofonun acemiliğiyle bazı şeyler yarım(!) oldu fakat konunun özünü anlamak için yeterli olacağını düşünüyorum. Şimdiden keyifli seyirler.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FiF00eob-Z0A%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DiF00eob-Z0A&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FiF00eob-Z0A%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/e2af0429121ba9d7c201589bf127591f/href">https://medium.com/media/e2af0429121ba9d7c201589bf127591f/href</a></iframe><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b36bcc26ea71" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Madalyonun öteki yüzü: 2020]]></title>
            <link>https://muratdogan.medium.com/madalyonun-%C3%B6teki-y%C3%BCz%C3%BC-2020-46c7e6b21cf4?source=rss-d58b91e8bb9a------2</link>
            <guid isPermaLink="false">https://medium.com/p/46c7e6b21cf4</guid>
            <category><![CDATA[pandemic]]></category>
            <category><![CDATA[health]]></category>
            <category><![CDATA[personal-development]]></category>
            <category><![CDATA[family]]></category>
            <category><![CDATA[2020]]></category>
            <dc:creator><![CDATA[Murat Dogan]]></dc:creator>
            <pubDate>Fri, 25 Dec 2020 13:21:00 GMT</pubDate>
            <atom:updated>2020-12-25T13:21:00.281Z</atom:updated>
            <content:encoded><![CDATA[<p>Bu senenin ne kadar kötü geçtiğini Ocak ayından beri konuşuyoruz aslında. O yüzden ben de bunlara bir yenisini eklemeyeceğim. Güzel şeyler de oldu 2020&#39;de. Onu konuşmak istedim. Sanki mahalle yanarken saçını taramak gibi olacak ama ben de kendi hayatımdan güzel şeyleri anlatacağım.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/0*k61gt9ot3xOUAR73" /><figcaption>Kızım ve Ben — Temmuz 2020, İzmir</figcaption></figure><h3>Aile</h3><p>Bu konuda tek değilim biliyorum fazlasıyla duydum bu söylemi: “Pandemi sayesinde ailemle daha çok vakit geçirdim.” Evet, benim için de bu pandemi süreci öncesindeki 1,5 yıla yakın yoğun bir iş temposunun telafi süreci gibi oldu. Eşim ve kızımla o kadar eğlenceli zaman geçirdik ki -arada birbirimize tabii ki sardık 🙄- dünya varmış dedim resmen.</p><p>Kızım 2 yaşını doldurduktan 1,2 ay sonra evden çalışmaya başlamam, en keyifli dönemine denk gelmemi sağladı. Aşağılarda belki tekrar değinirim bilmem ama bu süreçte dahi çok çalışan biri olarak sanırım ofiste olsaydım 3 yaşına kadar pek keyifli, bol vakit geçirememiş olacaktık.</p><p>Ailece orman yürüyüşleri, bahçede ekme biçme ile geçirilen zamanlar, deniz kenarına masa kurup vakit geçirmek, evde saatlerce Lego oynamak. Avrupada yaşayanlardan sıkça dinlediğimiz, onlar için gayet normal olan iş dışı hayat gerçekten mümkünmüş onu gördüm.</p><h3>İş Hayatı</h3><p>Bu senenin iş hayatımdaki karşılığı tam olarak bir akademi diyebilirim. 2019un sonlarında doğru çalıştığım şirkette kendimi saymazsak, sıfırdan bir frontend ekibi kurdum. Çoğunluğu (çeşitli bölümlerden) yeni mezun olan arkadaşlarla riskli ama bir o kadar da eğlenceli bir yolculuğa çıktık. Riskliydi çünkü önümüzde bizi bekleyen çok ciddi projeler vardı. Böyle bir ekip kurduğunuzda beklentiler de omuzlarınızda bir dağ gibi oluyor kimse bir şey demese de. Benim için öyleydi en azından. Eğlenceliydi çünkü sıfırdan bir şeyler öğretmek hem beni sıkça 11–12 sene önceme götürdü hem de başka ufak ufak şeyleri öğrenmeme vesile oldu.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*cDxEr7pwXmbKk55_" /></figure><h3>Hobi</h3><p>Bu sene bir diğer aydınlanmam da hobilere karşı oldu. Ben yıllarca hobimin işim olduğunu, böylelikle de hiç çalışmadığımı kendime empoze edip durmuşum. Ancak yine herkes gibi pandemide fazlasıyla çalışınca ve bir taraftan da ölüm diye bir gerçekle her gün yüzleştikçe bazı şeyleri kaçırdığımı farkettim. 31/32 yaş sularında bunu farkettiğim için çok geç kalmış sayılmam umarım vadem daha varsa 🤞</p><p>Ben de 2021 senesi içerisinde bol bol fotoğraf çekmeye karar verdim. Çevremde bu işi profesyonel olarak yapan arkadaşlarımdan aldığım cesaret ve “gaz” ile sanıyorum kısa süre sonra ben de o dünyaya giriş yapacağım. Şu an teorik eğitimleriyle açığı kapatmaya çalışıyorum ancak gün sonunda bir sanat icra etmeye niyetlendiğim için hafiften de tırsıyorum doğrusu 😃</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*foT4BoHe9w9NhoyC" /></figure><h3>Hayaller</h3><p>Tam olarak; “içerideyken düşünecek çok zamanım oldu” repliğindeki gibi, benim de pandemide düşünecek çok zamanım oldu, en azından öncesine göre. İnsan bu günlerin daha az hasarlı geçmesi için bir hayale sarılmak istiyor. Öteki türlü, okyanusun ortasında hiç kara görmeden günlerce seyahat ediyormuş gibi hissediyor insan.</p><p>Ben de boş durmadım ve bol bol hayaller kurdum. Bazıları çok <strong>radikal</strong>, bazıları çok <em>ütopik </em>bazıları da pek `mütevazi`.</p><p>Yeni yılı kapatırken sanıyorum herkes için sağlıktan başka bir şey dileyemiyorum. Ruhumuzdaki, bedenimizdeki acılarımızı bir an önce saracağımız, <strong>maskelerden bir an önce kurtulacağımız, </strong><em>dostlarımızla sarmaş dolaş şarkılar söyleyeceğimiz, </em>nice güzel yıllarınız olsun.</p><p>Aralık 2020,<br>Murat Doğan</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=46c7e6b21cf4" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Create custom fetch hook for multiple Axios instances]]></title>
            <link>https://itnext.io/create-custom-fetch-hook-for-multiple-axios-instances-661a73701f73?source=rss-d58b91e8bb9a------2</link>
            <guid isPermaLink="false">https://medium.com/p/661a73701f73</guid>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[react]]></category>
            <category><![CDATA[axios]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[react-hook]]></category>
            <dc:creator><![CDATA[Murat Dogan]]></dc:creator>
            <pubDate>Mon, 15 Jun 2020 14:39:04 GMT</pubDate>
            <atom:updated>2020-08-08T18:13:22.262Z</atom:updated>
            <content:encoded><![CDATA[<p>It might be fun when you first start to convert your existing codebase to hooks or start to write your components from scratch using React Hooks.</p><p>After a few repetitive components, you will get rid of the repeated code blocks, especially while making some network requests. There are so many similar things in each request code block. Setting loading indicator, handling errors, setting response data etc.</p><p>It sounds unnecessary until you feel that pain. I got this feeling at the very beginning of my project and needed to figure out a scalable and maintainable solution.</p><h3>Custom hooks!</h3><p>Custom hooks allow us to build new hooks using React’s hooks. As I mentioned before, If you have some repeated blocks, processes you can create middleware-ish hooks which handle this work for each time. It’s kind of utility function, in fact. So, let&#39;s build our own custom hook for Axios instances:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*vgeBQ7npDZR01_Y1" /><figcaption><a href="https://unsplash.com/photos/Wiu3w-99tNg">Credit: Unsplash</a></figcaption></figure><p>First thing first, let&#39;s define our instances:</p><pre>export const <strong><em>contentApi </em></strong>= <strong><em>axios</em></strong>.create({<br>   baseURL: contentApiUrl,<br>});<br><br>export const <strong><em>programApi </em></strong>= <strong><em>axios</em></strong>.create({<br>   baseURL: programApiUrl,<br>});</pre><p>I need to create this kind of instances because I need to group my requests and each of them needs different options, interceptors, base URLs etc. Because I have more than 8 different APIs.</p><p><em>Update: Many thanks to </em><a href="https://medium.com/@gouaks"><em>https://medium.com/@gouaks</em></a><em> I figured out an annoying problem which causes an infinite loop when I pass an object for data or config. Here is the updated version below.</em></p><p>Update 2: I got a great comment from <a href="https://medium.com/u/6ad46e4c7b42">Francis Rodrigues</a> that he has created a codesandbox sample using my file. Here is the demo:</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fcodesandbox.io%2Fembed%2Fgtiec&amp;display_name=CodeSandbox&amp;url=https%3A%2F%2Fcodesandbox.io%2Fs%2Fgtiec&amp;image=https%3A%2F%2Fcodesandbox.io%2Fapi%2Fv1%2Fsandboxes%2Fgtiec%2Fscreenshot.png&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=codesandbox" width="1000" height="500" frameborder="0" scrolling="no"><a href="https://medium.com/media/fd61248c78f491f09fb48229f6c4fef3/href">https://medium.com/media/fd61248c78f491f09fb48229f6c4fef3/href</a></iframe><p>Second, create a file called <strong><em>useFetch.js:</em></strong></p><pre>import { useState, useEffect } from &quot;react&quot;;<br><br>export default function useFetch({ api, method, url, data = <strong>null</strong>, config = <strong>null</strong> }) {<br>   const [response, setResponse] = useState(null);<br>   const [error, setError] = useState(&quot;&quot;);<br>   const [isLoading, setIsLoading] = useState(true);<br><br>   useEffect(() =&gt; {<br>      const fetchData = async () =&gt; {<br>         try {<br>            api[method](url, <strong><em>JSON</em></strong>.parse(config), <strong><em>JSON</em></strong>.parse(data))<br>               .then((res) =&gt; {<br>                  setResponse(res.data);<br>               })<br>               .finally(() =&gt; {<br>                  setIsLoading(false);<br>               });<br>         } catch (err) {<br>            setError(err);<br>         }<br>      };<br><br>      fetchData();<br>   }, [api, method, url, data, config]);<br><br>   return { response, error, isLoading };<br>}</pre><p>Here is the easiest way to get rid of using setLoading in every network request:</p><pre>import useFetch from &quot;../hooks/useFetch&quot;;</pre><pre>const {response, isLoading} = useFetch({<br>   api: <strong><em>programApi</em></strong>,<br>   method: &quot;get&quot;,<br>   url: &quot;/SportsProgram/active_sport_type&quot;,<br>   config: <strong><em>JSON</em></strong>.stringify({ requireAuthentication: true }),<br>});</pre><p>You can now listen to your response in useEffect and do whatever you want:</p><pre>useEffect(() =&gt; {<br>   if (response !== null) {<br>      // do more stuff if you wish<br>   }<br>}, [response]);</pre><p>It is always better to keep it easy to read and understand. If you have any comments to improve this hook, please let me know because this is my first custom hook shot!</p><p>Here is the gist URL: <a href="https://gist.github.com/muratdogan17/f5861e82e6db5545f651617823214172">https://gist.github.com/muratdogan17/f5861e82e6db5545f651617823214172</a></p><p>Enjoy</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=661a73701f73" width="1" height="1" alt=""><hr><p><a href="https://itnext.io/create-custom-fetch-hook-for-multiple-axios-instances-661a73701f73">Create custom fetch hook for multiple Axios instances</a> was originally published in <a href="https://itnext.io/">ITNEXT</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Dynamic Pagination Rendering with pure JavaScript ]]></title>
            <link>https://javascript.plainenglish.io/dynamic-pagination-rendering-with-pure-javascript-b5fcbccd300d?source=rss-d58b91e8bb9a------2</link>
            <guid isPermaLink="false">https://medium.com/p/b5fcbccd300d</guid>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[coding]]></category>
            <category><![CDATA[web-design]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[web-development]]></category>
            <dc:creator><![CDATA[Murat Dogan]]></dc:creator>
            <pubDate>Tue, 05 Nov 2019 10:38:44 GMT</pubDate>
            <atom:updated>2019-11-05T18:11:36.961Z</atom:updated>
            <content:encoded><![CDATA[<p>I have shared my experiences with creating sortable dynamic data tables. Now, I want to share another experimental story about dynamic pagination rendering.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*W-gxLXDDKNo-2Zec" /><figcaption>Credit: Unsplash <a href="https://unsplash.com/@markusspiske">@markusspiske</a></figcaption></figure><p>I had to build a pagination module in a project. I examined lots of pagination libraries but these were so over-engineered compared to the product team’s requirements. I decided to build it on my own to make it simpler and easier to implement. Indeed, this widget implemented lots of different projects all around the production environment which has more than 50 million users per month and It works like a charm 🚀</p><p>Let me list the requirements we got from the product team:</p><ul><li>We have a dynamic amount of elements</li><li>We want to show them dynamically per widget. e.g, while one widget is listing 10 of the elements per page another widget, may list 15 of the elements.</li><li>If it’s at the first or the latest page the arrow navigation buttons should be disabled, If the user clicks the active page it shouldn’t trigger anything, as well.</li><li>If we have more than 4 pages after the calculation regarding specs described below we need to show the latest page and show a button with three points. Here is the preview:</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*WFRZxTgb7zCogOJk.png" /></figure><p>It has to look like this, at the end of the pagination:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Q-uIVhq7_nph8d5S.png" /></figure><p>Let’s look at the working demo, first:</p><p>It’s enough to give so much information. Let’s get our hands dirty:</p><p>First thing first, my little component should have a state which affects the rendering of it.</p><pre>const <em>pagingOptions</em> = {<br>  totalCount: 40,// <strong>Total content count</strong><br>  itemPerPage : 5, // <strong>How many items will be showed per page</strong><br>  initialPage: 1, <strong>// Initial Page (We can set this parameter by detecting current page from query string)</strong><br>  get totalPage () { <strong>// Calculating total page count</strong><br>     return Math.ceil(this.totalCount / this.itemPerPage) <strong>// I&#39;m using Math.ceil for ceiling </strong><br>  },<br>  location: &quot;.paging&quot;, <strong>// It&#39;s the selector to render pagination component</strong><br>  url : &quot;/api/contents/?id=5a5e47ec7152d929bc6d4280&amp;p=&quot; <strong>// The url address which will be requested after each page changed.</strong><br>}</pre><p>It was a .net framework web application that’s why I can init my function inside the razor.</p><pre>paging.init(<em>pagingOptions</em>);</pre><p>I love to stick with Single Responsibility principle while coding so I want to list my functions before digging into the details:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*KaL2ezC812N4-BF9.png" /></figure><p>It’s also possible to merge <em>handleNextClick</em> and <em>handlePrevClick</em> functions but as I mentioned before this is just a POC. There may be so many points to improve inside the codebase. Please feel free to recommend better ways.</p><p>Let’s dig into the details. I’m passing down the current state using the init function. This is the function triggered each time when the page changed so I do request content part within this function</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*1jhXfLTt1csU__xk.png" /></figure><p>I want to mention one important method before I tell you about the createPaging method <strong>createButton. </strong>This method takes some parameters and helps me build each button regarding these parameters:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*TvmdErU5-Z0WKFe5.png" /></figure><p>And finally one big, “dirty” method createPaging. I call it dirty just because it has so many conditions. I examined lots of pagination libraries and as far as I see, almost all of them have this kind of conditions. I do not want to show whole code here not to make you confused so I named the variables clearly to your debug.</p><p>Thanks for your time reading until this line. Please feel free to share your thoughts about the codebase. There is always a better way to improve.</p><p>Murat</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b5fcbccd300d" width="1" height="1" alt=""><hr><p><a href="https://javascript.plainenglish.io/dynamic-pagination-rendering-with-pure-javascript-b5fcbccd300d">Dynamic Pagination Rendering with pure JavaScript 🚀</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[Sortable data tables using pure JavaScript]]></title>
            <link>https://javascript.plainenglish.io/sortable-data-tables-using-pure-javascript-3a34f7913478?source=rss-d58b91e8bb9a------2</link>
            <guid isPermaLink="false">https://medium.com/p/3a34f7913478</guid>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[coding]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[programming]]></category>
            <dc:creator><![CDATA[Murat Dogan]]></dc:creator>
            <pubDate>Thu, 31 Oct 2019 08:22:55 GMT</pubDate>
            <atom:updated>2019-11-01T10:26:55.243Z</atom:updated>
            <content:encoded><![CDATA[<p>It’s been a while for writing technical articles, that’s why I decided to write a new one but with one small difference. I decided to write this article in English. Here we go:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Q2zveD94ejFUKPSq.png" /><figcaption>Credit: <a href="https://unsplash.com/@_imkiran">https://unsplash.com/@_imkiran</a></figcaption></figure><p>There was a feature request in my current company, product team requested a table component which should order columns in ascending or descending way when clicking the column’s title. At the end of this post, you’ll see the working POC. There may be so many things to improve in the aspect of code quality but do not forget, this is just a POC. I’m looking forward to your responses to the code.</p><p>I have a table which has fixed headings. I have an array of objects including just four elements for the sake of simplicity. This table should be sorted by some properties of these objects, not all of them. I have to build this table without using any of the view libraries, just plain-old JavaScript!</p><p>I usually pay attention to write my functions by adopting the Single Responsibility Principle. This way provides so much convenience when both writing and debugging.</p><pre>&lt;table id=&quot;squadTable&quot; class=&quot;table table-dark table-striped&quot;&gt;<br>        &lt;thead&gt;<br>            &lt;tr&gt;<br>                &lt;th <strong>data-filter-value=&quot;no&quot;</strong> class=&quot;active&quot;&gt;No&lt;/th&gt;<br>                &lt;th&gt;Name&lt;/th&gt;<br>                &lt;th&gt;Position&lt;/th&gt;<br>                &lt;th <strong>data-filter-value=&quot;age&quot;</strong>&gt;Age&lt;/th&gt;<br>                &lt;th <strong>data-filter-value=&quot;match&quot;</strong>&gt;Match&lt;/th&gt;<br>                &lt;th <strong>data-filter-value=&quot;time&quot;</strong>&gt;Min&lt;/th&gt;<br>                &lt;th <strong>data-filter-value=&quot;goal&quot;</strong>&gt;Goal&lt;/th&gt;<br>                &lt;th <strong>data-filter-value=&quot;assist&quot;</strong>&gt;Ast&lt;/th&gt;<br>                &lt;th <strong>data-filter-value=&quot;yellowCard&quot;</strong>&gt;YC&lt;/th&gt;<br>                &lt;th <strong>data-filter-value=&quot;doubleYellowCard&quot;</strong>&gt;DYC&lt;/th&gt;<br>                &lt;th <strong>data-filter-value=&quot;redCard&quot;</strong>&gt;RC&lt;/th&gt;<br>            &lt;/tr&gt;<br>        &lt;/thead&gt;<br>        &lt;tbody&gt;</pre><pre>&lt;/tbody&gt;<br>&lt;/table&gt;</pre><p>I shared the Codepen link at the end of the post. I implemented the Bootstrap for a better look and feel. This is the purpose of some generic classes in the code above.</p><p>I have also highlighted the sortable columns by making them bold in the code. As I mentioned earlier this is a static POC so I’ve statically written data-filter-values. You can change them to template literals and generate using an array etc.</p><pre>th {<br>  &amp;[data-filter-value] {<br>            cursor: pointer;<br>        }  &amp;.active {<br>            color: red;<br>        }<br>}</pre><p>I do not have any CSSish concerns just because I’m using Bootstrap. I just want to differentiate the sortable and active columns. I added the Scss codes above.</p><p>Here is my data array of objects:</p><pre>const data = [{<br>            &quot;id&quot;: &quot;1233213&quot;,<br>            &quot;no&quot;: 17,<br>            &quot;fullName&quot;: &quot;Murat Doğan&quot;,<br>            &quot;position&quot;: &quot;CMD&quot;,<br>            &quot;age&quot;: 29,<br>            &quot;match&quot;: 12,<br>            &quot;time&quot;: 1080,<br>            &quot;goal&quot;: 12,<br>            &quot;assist&quot;: 4,<br>            &quot;yellowCard&quot;: 3,<br>            &quot;doubleYellowCard&quot;: 0,<br>            &quot;redCard&quot;: 2<br>        }, {<br>            &quot;id&quot;: &quot;41233213&quot;,<br>            &quot;no&quot;: 58,<br>            &quot;fullName&quot;: &quot;Volkan Demirel&quot;,<br>            &quot;position&quot;: &quot;GK&quot;,<br>            &quot;age&quot;: 28,<br>            &quot;match&quot;: 34,<br>            &quot;time&quot;: 3400,<br>            &quot;goal&quot;: 1,<br>            &quot;assist&quot;: 17,<br>            &quot;yellowCard&quot;: 8,<br>            &quot;doubleYellowCard&quot;: 3,<br>            &quot;redCard&quot;: 5<br>        }, {<br>            &quot;id&quot;: &quot;51233213&quot;,<br>            &quot;no&quot;: 18,<br>            &quot;fullName&quot;: &quot;Soldado&quot;,<br>            &quot;position&quot;: &quot;ST&quot;,<br>            &quot;age&quot;: 33,<br>            &quot;match&quot;: 5,<br>            &quot;time&quot;: 120,<br>            &quot;goal&quot;: 1,<br>            &quot;assist&quot;: 2,<br>            &quot;yellowCard&quot;: 5,<br>            &quot;doubleYellowCard&quot;: 1,<br>            &quot;redCard&quot;: 4<br>        }, {<br>            &quot;id&quot;: &quot;61233213&quot;,<br>            &quot;no&quot;: 27,<br>            &quot;fullName&quot;: &quot;Hasan Ali Kaldırım&quot;,<br>            &quot;position&quot;: &quot;DL&quot;,<br>            &quot;age&quot;: 18,<br>            &quot;match&quot;: 2,<br>            &quot;time&quot;: 12,<br>            &quot;goal&quot;: 0,<br>            &quot;assist&quot;: 1,<br>            &quot;yellowCard&quot;: 3,<br>            &quot;doubleYellowCard&quot;: 4,<br>            &quot;redCard&quot;: 5<br>        }];</pre><p>I don’t use id properties but it’s good to have unique keys for any purpose in the future.</p><p>These are the global variables for sorting:</p><pre>let currentFilter = &quot;no&quot;,<br>            prevFilter = &quot;&quot;,<br>            orderAsc = true;</pre><ul><li>The default sorting value of the table will be the number of the player(no). I set it as the current filter.</li><li>Prev filter value keeps the previously selected filter. It’s important to keep that data to handle click events applied to the same column. Converting it from ascending to descending or vice versa.</li><li>order ascending value keeps the current ordering type. It’s going to be changed regarding click actions.</li></ul><pre>const toggleOrder = () =&gt; {<br>            if (currentFilter === prevFilter) {<br>                orderAsc = !orderAsc; // Get same value and assign its opposite.<br>            } else { <br>             orderAsc = true;<em> </em><br>            }<br>        }</pre><p>As I mentioned before, If the user clicks to the same column name over and over it changes the direction of the ordering. I need an else situation here because if I order a column as descending other columns need to be ordered ascending. It’s kind of resetting order :)</p><pre>const sortTable = (array, sortKey) =&gt; {<br>           return array.sort((a, b) =&gt; {<br>                let x = a[sortKey],<br>                    y = b[sortKey];                return orderAsc ? x - y : y - x; // <a href="https://medium.com/@muratdogan/javascript-hap-yaz%C4%B1s%C4%B1-ternary-operator-2788782189fb">ternary operator</a> <br>            });<br>        }</pre><p>This is the function taking two arguments as an array and a sorting variable. I’m using Array.sort method here to catch the difference between the previous and next variables. If you want to compare the string values you can use greater than or less than signs. If you want to order by ascending it uses x-y or y-x for the opposite situation.</p><p>Here it comes to rendering table :</p><pre>const renderTable = tableData =&gt; {<br>            return (`${tableData.map(item =&gt; {<br>                return (<br>                    `&lt;tr&gt;<br>                        &lt;td&gt;${item.no}&lt;/td&gt;<br>                        &lt;td&gt;${item.fullName}&lt;/td&gt;<br>                        &lt;td&gt;${item.position}&lt;/td&gt;<br>                        &lt;td&gt;${item.age}&lt;/td&gt;<br>                        &lt;td&gt;${item.match}&lt;/td&gt;<br>                        &lt;td&gt;${item.time}&lt;/td&gt;<br>                        &lt;td&gt;${item.goal}&lt;/td&gt;<br>                        &lt;td&gt;${item.assist}&lt;/td&gt;<br>                        &lt;td&gt;${item.yellowCard}&lt;/td&gt;<br>                        &lt;td&gt;${item.doubleYellowCard}&lt;/td&gt;<br>                        &lt;td&gt;${item.redCard}&lt;/td&gt;<br>                    &lt;/tr&gt;`<br>                )<br>            }).join(&#39;&#39;)}`);<br>        }</pre><p>It’s the only purpose of this function that rendering the tr elements regarding given data. It loops using the map through the array and returns string output for each of them. If you are curious about the join method at the end of the chain, let me explain! Map function returns a new array and that join method helps us to <strong>join </strong>these array items by adding an empty string at the end of each item. source: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/join">Mdn</a></p><pre>const appendTable = (table, destination) =&gt; {<br>            document.querySelector(destination).innerHTML = table;<br>        }</pre><p>This function’s only purpose is appending the giving element to the given destination. The naming of this function might be more generic but as I mentioned before this is just a POC. You should rename it to append etc.</p><pre>const handleSortClick = () =&gt; {<br>            const filters = document.querySelectorAll(&#39;#squadTable th&#39;);<br>            Array.prototype.forEach.call(filters, filter =&gt; {<br>                filter.addEventListener(&quot;click&quot;, () =&gt; {<br>                    if (!filter.dataset.filterValue) return false;<br>                    Array.prototype.forEach.call(filters, filter =&gt; {<br>                        filter.classList.remove(&#39;active&#39;);<br>                    });<br>                    filter.classList.add(&#39;active&#39;);<br>                    currentFilter = filter.dataset.filterValue;<br>                    toggleOrder();<br>                    init();<br>                });<br>            })<br>        }</pre><p>It’s better to keep this section more detailed. I hardcoded the selector of the columns’ heading but you can pass selector as an argument. It’s not that hard.</p><p>I’m querying all the th elements and looping using a forEach. If you’re curious about why I didn’t use Array.forEach, let me explain: <em>filters </em>variable is a list but it’s just a <em>node list. </em>If you’re dealing with node lists you can’t use every method of Array. It provides both browser compatibility and access to the forEach.</p><p>I’m checking whether the header has a sorting property or not. If not, I return false at the very beginning of the function and do not execute the whole function.</p><p>I want to mention this pleasant feature: <strong>dataset</strong>. If you want to access the whole data attributes of a dom element, you can list all of them by using the dataset instead of using getAttribute(…). You should beware of the usage. data attributes are kebap-case but you need to access them by using camelCase.</p><p>I’m doing some class job and triggering toggle function. I’m triggering init function, as well.</p><pre>const init = () =&gt; {<br>      let newTableData = sortTable(data, currentFilter),<br>          tableOutput = renderTable(newTableData);appendTable(tableOutput, &#39;#squadTable tbody&#39;);<br>        prevFilter = currentFilter;<br>        }</pre><p>I’m doing all the short works here. Let’s have a look at what’s going on:</p><ul><li>I’m reformatting my player data using the current filter parameter. It helps me by making sorting easily when I change the current filter inside other functions.</li><li>Creating string Html output for the table assigning to the <em>tableOutput</em>.</li><li>I’m appending this output to where I declare.</li><li>I can assign the current filter as the previous filter at the end of the whole process finishes.</li></ul><pre>init();<br>handleSortClick();</pre><p>I call init function inside other functions so I do not call handleSortClick inside the init function. This prevents rebinding the events to the selectors. You may share better ways to improve this code.</p><p>It takes only ~70 lines of code when creating the table. If we keep the data objects separated. It depends on the template but I think it’s quite short and easy to implement.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fcodepen.io%2Fmuratdogan17%2Fembed%2Fpreview%2FqozQVr%3Fheight%3D600%26slug-hash%3DqozQVr%26default-tabs%3Djs%2Cresult%26host%3Dhttps%3A%2F%2Fcodepen.io&amp;url=https%3A%2F%2Fcodepen.io%2Fmuratdogan17%2Ffull%2FqozQVr&amp;image=https%3A%2F%2Fscreenshot.codepen.io%2F1663762.qozQVr.small.58f0d6af-ca34-4277-997d-732c260af08b.png&amp;key=d04bfffea46d4aeda930ec88cc64b87c&amp;type=text%2Fhtml&amp;schema=codepen" width="800" height="600" frameborder="0" scrolling="no"><a href="https://medium.com/media/c3bf03421b1cb5919af8727cbeb5a711/href">https://medium.com/media/c3bf03421b1cb5919af8727cbeb5a711/href</a></iframe><p><a href="https://codepen.io/muratdogan17/embed/qozQVr?height=353&amp;theme-id=0&amp;default-tab=js,result">CodePen Embed - Pure JavaScript Sortable Table</a></p><p>Thanks for reading this article until this line. I’m looking forward to your responses to make this code even better.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3a34f7913478" width="1" height="1" alt=""><hr><p><a href="https://javascript.plainenglish.io/sortable-data-tables-using-pure-javascript-3a34f7913478">Sortable data tables using pure JavaScript</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[Ben nasıl büyük developer olucam *]]></title>
            <link>https://muratdogan.medium.com/ben-nas%C4%B1l-b%C3%BCy%C3%BCk-developer-olucam-5e4c1e69bf6a?source=rss-d58b91e8bb9a------2</link>
            <guid isPermaLink="false">https://medium.com/p/5e4c1e69bf6a</guid>
            <category><![CDATA[self]]></category>
            <category><![CDATA[development]]></category>
            <category><![CDATA[personal-development]]></category>
            <category><![CDATA[self-improvement]]></category>
            <dc:creator><![CDATA[Murat Dogan]]></dc:creator>
            <pubDate>Thu, 27 Dec 2018 13:10:11 GMT</pubDate>
            <atom:updated>2018-12-27T13:10:11.615Z</atom:updated>
            <content:encoded><![CDATA[<p>Profesyonel iş hayatında 10. yılıma girdiğim şu dönemlerde, teknik olarak hangi konuyu anlatsam diye düşünürken aslında teknik olmayan ama en çok ihtiyaç duyulan bir hususta yazmaya karar verdim. Nereden başlamalıyım?</p><p>Bugün belki de en uzun yazımı yazacağım, umarım kariyerinin başında, ortasında veya ilerisinde farketmez, bir çıkış noktası arayan arayüz geliştiricilere ufak da olsa bir ilham verebilirim.</p><ul><li>Başlığın çıkış noktası videomu da buraya bırakayım :</li></ul><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2F4z3pffIEXWM%3Ffeature%3Doembed&amp;url=http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3D4z3pffIEXWM&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2F4z3pffIEXWM%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/65b864bd12ce174671802ef47fc2dd9a/href">https://medium.com/media/65b864bd12ce174671802ef47fc2dd9a/href</a></iframe><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*OBKJWmNZuYsPKxQA" /></figure><h4>Nereden başlamalıyım?</h4><p>Yazılım geliştirmeye yeni başlayan arkadaşlardan sıkça duyduğum bir soru. Cevabı ise bir o kadar karmaşık. Sonuçlar ise bir o kadar hüsran. İlgili okullardan mezun olan arkadaşlardan şimdiye kadar tanışma fırsatım olanlardan aldığım feedbacklerde şöyle bir seçime gidiyorlar. “Görünür işler yapmayı sevdiğim için Front End alanında ilerlemek istiyorum.” Biraz daha derinine indiğimde ise, malesef ki bi çoğunda gerçek şu: “Daha kolay gözüktüğü için front end yapacağım”. İşler bu noktadan sonra karmaşıklaşıyor çünkü 10 sene öncesiyle şu an front end dünyasının geldiği nokta bambaşka. Kıtaların ayrılmaya başlayıp şu an geldiği nokta gibi diyebiliriz ki kıtalarda olan hareketlilik bizim alanımızda da hala var. Değişim, dönüşüm asla durmuyor.</p><p>Her neyse, genç arayüzcü arkadaşımız başlıyor işe. Önce birkaç forum taranıyor, blog postlar inceleniyor:</p><ul><li>Html var CSS var, bir de JavaScript var.</li><li>Hımmm…</li><li>SCSS mi? Farkı ne ki? LESS, Stylus? Bunlar ne böyle?</li><li>Task runner mı kuracağım?</li><li>Ama node yüklü değil ben backend yapmayacağım ki?</li><li>jQuery? MVC kütüphaneler mi?</li><li>Nasıl ya React de ne şimdi?</li><li>Gulp öğrenmiştim Webpack nereden çıktı?</li><li>Angular da pek revaçtaymış?</li><li>TypeScript????</li><li>🏃🏼‍♂️️️️🏃🏼‍♂️</li></ul><p>Şimdi tüm bu yukarıdaki teknik şeyleri bir kenara bırakın, gelin size çok başka şeylerden bahsedeyim.</p><h4>Kural 0</h4><p>Diğerlerinin sıralamasını belki değiştirebilirsiniz ama bu hep en başta kalsın derim ben.</p><blockquote>Hayatta z-index’ten daha önemli şeyler var! — Murat</blockquote><p>Bu sözü sektörde daha çok toyken söylemiştim. Hala da zaman zaman aklıma gelir gülerim. Ne demek peki bu? İşinizin hayatınızdaki en önemli şey olduğu yanılgısına kapılmayın. Ailenizi, dostlarınızı, arkadaşlarınızı ve kendinizi unutmayın. Evet birazdan size gece gündüz çalışın, okuyun ve öğrenin diyeceğim belki ama o aradaki dengeyi lütfen kurun. Güzel ve mutlu bir sosyal hayat sizi iş hayatında da bir adım ileriye götürecektir.</p><h4>Kural 1 — Merak</h4><p>Merak edin! Merak edin ve söylemiş miydim? Merak edin!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*ZMXMHERgFx29KMEc" /><figcaption>Credit: <a href="https://unsplash.com/photos/93q1OMq5uHE">Unsplash</a></figcaption></figure><p>Bizim işin olmazsa olmazıdır. Eğer içinizde bu işe dair merakınızı tetikleyecek bir heyecanınız yoksa lütfen klavyeyi fareyi bırakın ve başka bir alanda meslek edinin.</p><p>Bu yılıma geldim hala güzel bir komponent, işleyiş vs gördüğümde nasıl yapmış diye bakıyorum. Bir çoğu ufkumu açıyor. Bir şey yaparken acaba şöyle de yapsam nolur diye düşünüp öylesini araştırıyorum.</p><p>Başka bir şey daha söyleyeceğim meraka dair. Bir iş yerine görüşmeye gidiyorsanız, lütfen ama lütfen o şirketin ürünlerini bi merak edip inceleyin :) Görüşmede bulgularınızı paylaşın, siz olsanız nasıl çözerdiniz onu paylaşın ya da gözünüze güzel gelen bir komponentin nasıl yapıldığını çözemediyseniz onu sorun o şirketin teknik sorumlusuna. Düşünsenize ne kadar kaliteli geçer o görüşme?</p><h4>Kural 2 — İngilizce!</h4><p>Bu konuda sakın ha sakın milliyetçi takılmayın. Yazdığınız komut satırlarından, o dilin dökümanlarına kadar istisnalar olmadıkça İngilizce egemen bir dünyanın içerisindesiniz. Bu konuda kendinizi belirli bir seviyeye getirmeniz gerekmekte. Bir sorunu araştıramadığınız noktada kilitlenirsiniz. Yeri gelecek ilgili canlı mesajlaşma alanlarında, github issueları açarak, stackoverflow’da sorarak ve sorulmuşları okuyarak ilerleyeceksiniz. Türkçe ile ne yazık ki ilerlemeniz mümkün değil! Bu konuda çeşitli eğitim yöntemleri var, kendinize uygun olan bir tanesini seçin ve üzerine vakit harcayın lütfen.</p><h4>Kural 3 — Oku, izle, uygula!</h4><p>Herkesin öğrenme biçimi farklı. Kimisi izleyerek, kimisi dinleyerek, kimisi deneyerek öğrenir. Önemli olan bu sürecin belirli bir patterni olması ve o yolu takip etmeniz. Ne kadar çeşitli kaynaktan beslenirseniz o kadar çeşitli noktaya ulaşabilirsiniz. Tabii ki bu kaynak çokluluğu sizi ilk zamanlar bir girdabın içine sürükleyebilir. Yukarıda yazdığım gibi öğrenecek çok fazla şey var ve hepsinin aynı anda olması mümkün değil. Bir konu belirleyin kendinize ve onunla ilgili beyincikten kod yazacak kıvama gelene kadar durmayın, dağılmayın.</p><h4>Kural 4 — 10.000 saat</h4><p>“Practice makes perfect!” sözü tam olarak bu kuralın karşılığı. Malcolm Gladwell’e göre kural basit. Bir işte ustalaşabilmeniz için o işte en az 10.000 saat harcamanız gerekiyor. Tabii ki rakamın eksiği fazlası tartışılır. Burada asıl söylenmek istenen, bir iş üzerinde vakit ve emek harcayarak ancak o işte ustalaşılabilir.</p><p><a href="http://collective-thoughts.com/wp-content/10000-hour-rule-gladwell-outliers1.png">Infografik</a></p><p>Ne yazık ki Udemy.com’dan alacağınız 2 kurs sizi iyi bir developer yapmaz.</p><p>Buraya kadar geldiniz ve bu sözlerimden sonra, “Hocam, iyi de tecrübesisiz diye kimse işe almıyor biz bu saatleri, bu emekleri nerede harcayacağız!!!” dediniz biliyorum :)</p><p>Hadi udemy’den aldığınız eğitimleri bitirdiğinizi varsayarak yapmanız gerekenleri yazalım. Başka şeyler aklına gelen olursa lütfen yorumdan yeşillendirsin.</p><p>1- GitHub hesabı açın. O eğitimlerde öğrendiğiniz şeyleri uyguladığınız repolarınız olsun. O projeleri daha sonra, farklılaştırdığınız başka repolarınız olsun, sadece tutorial çıktıları olmasın.</p><p>2- Bu repolarda muhakkak branching modellerini deneyin. Birden fazla branchiniz, merge requestiniz, sayısız commitleriniz olsun. Böylelikle VCS(Versiyon kontrol sistemi) denilen olguya da otomatik olarak alışkın yetişmiş olursunuz.</p><p>3- Sevdiğiniz beğendiğiniz siteleri, ben olsam nasıl yapardım diyerek öğrendiğiniz teknolojilerle yapmaya çalışın. Kimse bunun için sizi suçlamayacaktır, sitemi çaldın, kopyaladın vs diye. Sonra atın bunları da reponuza. Şimdiden, bi yere başlamadan kaç tane projeniz oldu farkında mısınız?</p><p>4- Yetmedi! Gidin, behance, deviantart, themeforest vs gibi yerlerden tasarımlar bulun. jpg de olsa atın photoshopa onu parçalamaya çalışın. Dinamiklik katın. Atın repoya. Hop birkaç portföy daha.</p><p>Sanırım artık “Gösterecek projem yok!” tezinizi çürüttük.</p><h4>Kural 5 — İletişim</h4><p>Meslek hayatınız boyunca belki kodlarınız üzerinden para kazanacaksınız ama etrafınızda her zaman insanlar olacak. Size işi getiren iş birimleri, işinizi test edecek birimler, kabul edecek müşteriler, hepsinden öte tüm gününüzü paylaşacağınız iş arkadaşlarınız. Bu insanlarla iletişiminizin iyi olması sizi çok rahat ettirir. Evet sektörün başında çoğumuz ürkek, çekingen, utangaç vs olabiliyoruz, kişiliğinize oranla bu süreç bir süre sonra çözülebiliyor ancak siz bunu olabildiğince kısa tutmaya çalışın.</p><p>Bir diğer iletişim kanalı da etkinlikler. Sektöre dair etkinliklere muhakkak gidin. Her zaman herkesten öğrenecek bir şeyleriniz olduğunu aklınızdan çıkartmayın. Gerek anlatıcıdan, gerek oraya katılan katılımcılardan öğrenecek çok şeyiniz var.</p><p>Bir de burada altın bir nokta var ki o da <strong>Network. </strong>Güçlü bir network sizin dilediğiniz yerlerde çalışmanız için muhakkak ki yardımcı olacaktır. Burada torpilden bahsetmiyorum, evet torpil her sektörde olduğu gibi bizim sektörde de var. Bununla Don Kişot gibi kavga etmenin alemi yok. Siz yaptıklarınız ve kalitenizle aranan bir geliştirici olduğunuzda zaten torpillere takılmadan ilerleyebilirsiniz.</p><p>İletişimin en önemli noktalarından biri de <strong>soru sorma kabiliyetidir. </strong>Her zaman için bilmediğiniz ve soracağınız bir dünya şey olacak, burada doğru soruyu sormak çok önemli. En basitinden nasıl soru sorulmamasına bir örnek vermek istiyorum:</p><p>“React ile beraber styled-component kullandım ama hata veriyor!!!” bu minvalde bir sürü soru gördüm. Eğer ne var bu soruda diyenleriniz varsa bir kuple açıklayayım:</p><ul><li>En önemli geri-soru şu: Ne hatası veriyor? :)</li><li>O verdiği hatayı araştırdın mı?</li><li>Bulduğun çözümleri denerken farklı bir hatayla karşılaştın mı?</li><li>Kaç farklı çözümü denedin?</li><li>…</li></ul><p>Eğer doğru soruyu, doğru zamanda ve kişilere sorarsanız artık o cevabı unutmanız mümkün değil. Daha sorunun başındayken soru sorup, cevabını alıp kopyalayıp yapıştırmak, tutorial izlerken bakıp yapıp kapattığından unutmak gibidir. Bunu yapmayın kendinize.</p><h4>Teknik olarak nasıl bir yol haritası izlemeliyim?</h4><p>Bu soru da alt sorularıyla yanlış sorulabilen sorulardan biri. Daha yolun başındayken hangi framework ile ilerlemeliyim şeklinde sorular gelebiliyor. Öncelikle işin temelinde iyi olmanız gerekiyor. Scss yazmadan evvel bol miktarda CSS yazıp, daha sonra Scss’in hangi sorunları çözdüğünü anlamanız temelinizi güçlendirir. Bodozlama jQuery’e dalmadan evvel pure JavaScript öğrenmeniz, ihtiyacınız halinde onu kullanmanıza olanak sağlar. Bu örneği sıkça veriyorum. ES6&#39;daki class, constructor vs gibi yapıları React’in syntaxi olarak öğrenen, düşünen bir güruh yetişiyor.</p><p>Evet öğrenim eğrisi dediğinizi duyar gibiyim ancak şunu söylemekte fayda var. Kimse kolay olacağını söylemedi? :)</p><p>Son olarak, asla ben oldum demeyin! Ben bu yazıyı ben oldum hadi sıra sizde diyerek yazmıyorum. Bu yazıyı yayınladıktan sonra bile sizden gelecek geri bildirimlerden öğrenecek çok şeyim var. İlk defa böyle bir yazı yazdım çünkü ihtiyaç olduğunu düşünüyorum. Eğer fırsatım olursa 2019&#39;da bu yazıdan çok daha fazlasını yapabilmek için çeşitli girişimlerim olacak. Ben birileri benimle bilgisini paylaştığı için bu meslekten para kazanıyorum. İstiyorum ki ben de birilerinin hayatına dokunayım ve onlar da mutlu oldukları/olacakları işleri yapsınlar.</p><p>Bir sonraki yazıya kadar, esen kalın! :)</p><p>Şimdiden nice mutlu yıllar!</p><p>Murat DOĞAN — 27.12.2018</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*B9rJNhvdWF4m7u0b" /><figcaption>Credit: <a href="https://unsplash.com/photos/SBdmQcW8qag">Unsplash</a></figcaption></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5e4c1e69bf6a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Node.js ile site içeriklerini kazımak ]]></title>
            <link>https://muratdogan.medium.com/node-js-ile-site-i%C3%A7eriklerini-kaz%C4%B1mak-7823e04d393e?source=rss-d58b91e8bb9a------2</link>
            <guid isPermaLink="false">https://medium.com/p/7823e04d393e</guid>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[node]]></category>
            <category><![CDATA[nodejs]]></category>
            <category><![CDATA[javascript]]></category>
            <dc:creator><![CDATA[Murat Dogan]]></dc:creator>
            <pubDate>Wed, 26 Dec 2018 12:31:39 GMT</pubDate>
            <atom:updated>2018-12-26T12:31:39.549Z</atom:updated>
            <content:encoded><![CDATA[<p>Bir websitesini kazımanın çeşitli legal, illegal sebepleri olabiliyor. Kimisi gerçekten içeriğini kopyalayıp benzeri siteler yapmak için, kimisi yenilikleri takip edebilmek için çeşitli siteleri kazıyıp kendine bir feed oluşturmak için, kimisi sevdiği şirketin iş ilanlarını kaçırmamak için bla bla bla… :)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*qy1YfbpcSJ3lzTcJ" /><figcaption>Credit : <a href="https://unsplash.com/photos/kTa-D7Sl7SU">Unsplash</a></figcaption></figure><p>Bu görseli özellikle seçtim çünkü veri toplama işini doğru kurgularsanız her çiçekten topladığınız polenlerle kendi balınızı oluşturabilirsiniz. 🍯</p><h4>Neler yapacağız?</h4><p>Yapacağımız işlem aslında oldukça basit. Bir web sayfasına istekte bulunacağız. O istek sonucunda bize sayfanın outputu dönecek. Biz de o output içerisinden dilediğimiz elemanları seçip işleyeceğiz.</p><p>Bunları yaparken de iki araç kullanacağız. Birisi http istekleri için <a href="https://www.npmjs.com/package/axios"><strong>axios</strong></a><strong> </strong>diğeri ise bu istek sonrasında gelen DOM’da gezinebilmek için ihtiyacımız olacak olan <a href="https://www.npmjs.com/package/jsdom"><strong>jsdom</strong></a></p><h4>Hadi Başlayalım</h4><p>Öncelikle kendimize bir klasör oluşturuyoruz</p><pre>mkdir nodescrap &amp;&amp; cd nodescrap</pre><p>sonrasında teferruatlarıyla uğraşmamak ve hızlı kurmak adına npm ilişkilendirmesini şu şekilde yapıyoruz:</p><pre>npm init -y</pre><p>Buradaki -y komutunu şu şekilde açıklayabilirim. Normalde bu init işlemini</p><pre>npm init</pre><p>komutu ile yaparız ve bize o sırada çeşitli sorular sorar, projenin ismi, versiyonu vs vs. -y kullandığımız noktada ise bu soruları sormadan default değerleri alarak kurulumu gerçekleştiriyor. Hemen sonrasında ise ihtiyacımız olan diğer paketleri yüklüyoruz :</p><pre>npm i axios jsdom</pre><p>Böylelikle şöyle bir package.json dosyasımız oluyor :</p><pre>{</pre><pre>  &quot;name&quot;: &quot;nodescrap&quot;,</pre><pre>  &quot;version&quot;: &quot;1.0.0&quot;,</pre><pre>  &quot;description&quot;: &quot;&quot;,</pre><pre>  &quot;main&quot;: &quot;index.js&quot;,</pre><pre>  &quot;scripts&quot;: {</pre><pre>    &quot;test&quot;: &quot;echo \&quot;Error: no test specified\&quot; &amp;&amp; exit 1&quot;</pre><pre>  },</pre><pre>  &quot;keywords&quot;: [],</pre><pre>  &quot;author&quot;: &quot;&quot;,</pre><pre>  &quot;license&quot;: &quot;ISC&quot;,</pre><pre>  &quot;dependencies&quot;: {</pre><pre>    &quot;<strong>axios</strong>&quot;: &quot;^0.18.0&quot;,</pre><pre>    &quot;<strong>jsdom</strong>&quot;: &quot;^13.1.0&quot;</pre><pre>  }</pre><pre>}</pre><p>Bundan sonra yine terminal üzerinden kendimize bir index.js dosyası oluşturuyoruz :</p><pre>touch index.js</pre><p>Artık editörümüze geçebiliriz.</p><p>Ben bu örnekte hurriyet.com.tr’nin manşet üzerindeki 4&#39;lü haber alanını çekmek istiyorum. O çekeceğim haberleri belki de ufak bir arayüzle kendi local sayfamda göstereceğim. Bu sebeple tanımlamayı o şekilde yapacağım.</p><pre>const axios = require(&#39;axios&#39;),</pre><pre>      jsdom = require(&#39;jsdom&#39;),</pre><pre>      { JSDOM }=  jsdom,</pre><pre>      url = &#39;https://www.hurriyet.com.tr&#39;;</pre><p>şimdi belirttiğim urle istek atacağım ve sonrasında response’un datasını işlemesi için fonksiyonuma paslayacağım :</p><pre>axios.get(url)</pre><pre>  .then (response =&gt; {</pre><pre>    <strong>getNodes</strong>(<em>response.data</em>);</pre><pre>  })</pre><pre>  .catch(error =&gt; {</pre><pre>    console.error(error);</pre><pre>  })</pre><p>Bundan sonrası da o istekten gelen komple sayfayı tıpkı bir döküman gibi işlemek :</p><pre>const getNodes = html =&gt; {</pre><pre>  const data = [], <strong>// Boş bir array oluşturuyoruz</strong></pre><pre>  dom = new JSDOM(html), <strong>// Yeni bir JSDOM instanceı alıyoruz</strong></pre><pre>  news = dom.window.document.querySelectorAll(&#39;<strong>.flash-four-widget-css a</strong>&#39;); <strong>// dom&#39;dan gelen nodelar arasında gezerek o modülün içerisindeki a etiketlerini çekiyorum.</strong></pre><pre>  news.forEach(item =&gt; { <strong>// daha sonra bu seçtiğim öğelerde dönüyorum</strong></pre><pre>    data.push({ <strong>// yukarıdaki boş arraye her elemanın title ve href özelliklerini atıyorum</strong></pre><pre>      title: item.getAttribute(&#39;title&#39;),</pre><pre>      link: item.getAttribute(&#39;href&#39;)</pre><pre>    })</pre><pre>  });</pre><pre>  console.log(data); <strong>// Arrayin son halini yazdırıyorum. Burada elinize gelen data ile ne yapacağınız size kalmış :)</strong></pre><pre>}</pre><p>Şimdi dosyamızı çalıştırıyoruz:</p><pre>node index</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/898/1*FEdRbIomOnln5hmUuCcpRA.png" /></figure><p>Bu noktadan sonra o obje ile dilediğiniz mini uygulamayı gerçekleştirebilirsiniz. Gerisi sizin hayal gücünüze kalmış :)</p><p>Kaynaklar :</p><ul><li><a href="https://blog.bitsrc.io/https-blog-bitsrc-io-how-to-perform-web-scraping-using-node-js-5a96203cb7cb">https://blog.bitsrc.io/https-blog-bitsrc-io-how-to-perform-web-scraping-using-node-js-5a96203cb7cb</a></li><li><a href="https://www.npmjs.com/package/axios">https://www.npmjs.com/package/axios</a></li><li><a href="https://www.npmjs.com/package/jsdom">https://www.npmjs.com/package/jsdom</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7823e04d393e" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>