<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Baransel Arslan - Web Development Tips &amp; Tutorials</title><link>https://baransel.dev/</link><description>Recent content on Baransel Arslan - Web Development Tips &amp; Tutorials</description><generator>Hugo -- gohugo.io</generator><language>en-us</language><lastBuildDate>Thu, 02 Apr 2026 10:00:00 +0000</lastBuildDate><atom:link href="https://baransel.dev/index.xml" rel="self" type="application/rss+xml"/><item><title>I Built a Solana MEV Bot — Here's What I Learned</title><link>https://baransel.dev/post/i-built-a-solana-mev-bot-heres-what-i-learned/</link><pubDate>Thu, 02 Apr 2026 10:00:00 +0000</pubDate><guid>https://baransel.dev/post/i-built-a-solana-mev-bot-heres-what-i-learned/</guid><description>A few months ago I swapped some SOL for a token on Jupiter. Nothing unusual. But when I checked the transaction on Solscan, there were two other transactions sandwiching mine — one right before, one right after, same token, same block. I&amp;rsquo;d been sandwiched.
I wasn&amp;rsquo;t even mad. I was curious. How did they do that? Solana doesn&amp;rsquo;t have a public mempool like Ethereum. So how did someone see my transaction before it landed?</description></item><item><title>Build a Solana Copy Trading Bot That Mirrors Whale Wallets</title><link>https://baransel.dev/post/build-solana-copy-trading-bot-mirrors-whale-wallets/</link><pubDate>Tue, 31 Mar 2026 10:00:00 +0000</pubDate><guid>https://baransel.dev/post/build-solana-copy-trading-bot-mirrors-whale-wallets/</guid><description>I kept seeing the same thing on Solana. Some wallets would buy a token early, ride it up 10x, and sell before the dump. Over and over. Not once or twice — consistently.
So I thought: what if I just copied them? Not manually refreshing Solscan like some degenerate. An actual bot that watches their wallet, detects a swap, and mirrors it on mine within seconds.
I built it. It works.</description></item><item><title>Arbitrage on Solana: Find Price Gaps Between DEXs with Node.js</title><link>https://baransel.dev/post/solana-arbitrage-find-price-gaps-between-dexs-nodejs/</link><pubDate>Sun, 29 Mar 2026 10:00:00 +0000</pubDate><guid>https://baransel.dev/post/solana-arbitrage-find-price-gaps-between-dexs-nodejs/</guid><description>I was watching a SOL/USDC pool on Raydium one night when I noticed the price was about 0.3% higher than what Orca was showing. It lasted maybe 8 seconds. By the time I opened a second tab, it was gone.
That got me obsessed. I spent the next two weeks building a scanner that watches multiple DEXs at once and flags price gaps in real time. I didn&amp;rsquo;t get rich. But I learned more about how Solana DEXs actually work than months of reading docs ever taught me.</description></item><item><title>Build a Solana Price Alert Bot in 50 Lines of TypeScript</title><link>https://baransel.dev/post/solana-price-alert-bot-50-lines-typescript/</link><pubDate>Thu, 26 Mar 2026 10:00:00 +0000</pubDate><guid>https://baransel.dev/post/solana-price-alert-bot-50-lines-typescript/</guid><description>I was watching a token on Solana and kept refreshing DEXScreener like an idiot. Every few minutes, tab switch, refresh, check the price, go back to what I was doing.
After an hour of that, I thought — I&amp;rsquo;m a developer. Why am I doing this manually?
So I wrote a bot. It took 20 minutes and it&amp;rsquo;s under 50 lines. Here it is.
The Full Bot import { Connection, PublicKey } from &amp;#34;@solana/web3.</description></item><item><title>How to Decode Solana Program Logs Like a Pro</title><link>https://baransel.dev/post/decode-solana-program-logs-like-a-pro/</link><pubDate>Wed, 25 Mar 2026 10:00:00 +0000</pubDate><guid>https://baransel.dev/post/decode-solana-program-logs-like-a-pro/</guid><description>Every Solana transaction comes with program logs. Most people ignore them. I used to be one of those people.
Then I needed to figure out why a swap failed, and the only useful information was buried in the logs. After that, I started treating logs as the primary debugging tool on Solana. Not Solana Explorer. Not the raw transaction JSON. The logs.
Here&amp;rsquo;s everything I&amp;rsquo;ve learned about reading them.
1.</description></item><item><title>Build a Solana Token Sniper Bot with JavaScript</title><link>https://baransel.dev/post/build-solana-token-sniper-bot-javascript/</link><pubDate>Tue, 24 Mar 2026 10:00:00 +0000</pubDate><guid>https://baransel.dev/post/build-solana-token-sniper-bot-javascript/</guid><description>I&amp;rsquo;ll be honest — my first sniper bot was terrible. It missed every launch by at least 10 blocks, and when it did buy, the slippage ate me alive.
But after rewriting it three times, I got something that actually works. It detects new Raydium liquidity pools, checks basic safety signals, and executes a buy — all within a few seconds of pool creation.
I&amp;rsquo;m not going to pretend this will make you rich.</description></item><item><title>Monitor Any Solana Wallet in Real-Time with Node.js</title><link>https://baransel.dev/post/monitor-any-solana-wallet-real-time-nodejs/</link><pubDate>Mon, 23 Mar 2026 10:00:00 +0000</pubDate><guid>https://baransel.dev/post/monitor-any-solana-wallet-real-time-nodejs/</guid><description>I spent way too long polling getSignaturesForAddress in a loop. Every 3 seconds, hitting the RPC, checking if there&amp;rsquo;s a new transaction. It worked, but it was ugly and slow.
Then I found out you can just subscribe to account changes over WebSocket. No polling. No wasted requests. You get notified the moment something happens.
Here&amp;rsquo;s exactly how I do it now.
1. Set Up a WebSocket Connection @solana/web3.js has built-in WebSocket support.</description></item><item><title>I Built a Pomodoro App. Here's Why.</title><link>https://baransel.dev/post/i-built-a-pomodoro-app-heres-why/</link><pubDate>Sun, 08 Mar 2026 10:00:00 +0000</pubDate><guid>https://baransel.dev/post/i-built-a-pomodoro-app-heres-why/</guid><description>I&amp;rsquo;ve tried every Pomodoro app out there. Seriously. Forest, Focus Keeper, Be Focused, random ones with 4.8 stars and 12 reviews. They all did the same thing — a timer that counts down from 25 minutes. Some of them did it with trees. Some with pixel art. Some with way too many settings.
None of them felt right.
So I built my own. It&amp;rsquo;s called Foku, and it&amp;rsquo;s now live on the App Store.</description></item><item><title>Database Indexing Explained With Real PostgreSQL Examples</title><link>https://baransel.dev/post/database-indexing-explained-with-postgresql/</link><pubDate>Sat, 07 Mar 2026 02:13:50 +0000</pubDate><guid>https://baransel.dev/post/database-indexing-explained-with-postgresql/</guid><description>I ignored database indexing for way too long. My queries worked fine in development with 100 rows. Then production hit a few thousand rows and suddenly everything was slow. A page that loaded in 200ms now took 3 seconds. The fix was almost always the same: add an index.
But I also learned that indexes aren&amp;rsquo;t free. Add too many and your writes slow down. Add the wrong ones and they sit there taking up space doing nothing.</description></item><item><title>WebSockets in Node.js — A Practical Guide</title><link>https://baransel.dev/post/websockets-in-nodejs-practical-guide/</link><pubDate>Fri, 06 Mar 2026 02:13:50 +0000</pubDate><guid>https://baransel.dev/post/websockets-in-nodejs-practical-guide/</guid><description>Most web apps work fine with regular HTTP requests. Client asks for something, server responds, done. But sometimes you need the server to push data to the client without being asked. Live notifications, chat messages, real-time dashboards, collaborative editing. That&amp;rsquo;s where WebSockets come in.
I avoided WebSockets for a long time because they seemed complicated. Persistent connections, heartbeats, reconnection logic, all stuff I didn&amp;rsquo;t want to deal with. But once I actually built something with them, I realized the basics are surprisingly simple.</description></item><item><title>Authentication in Next.js Without Overcomplicating It</title><link>https://baransel.dev/post/authentication-in-nextjs-without-overcomplicating-it/</link><pubDate>Thu, 05 Mar 2026 02:13:50 +0000</pubDate><guid>https://baransel.dev/post/authentication-in-nextjs-without-overcomplicating-it/</guid><description>Authentication is one of those things that should be simple but somehow never is. Every time I start a new Next.js project, I spend way too long deciding between NextAuth, Clerk, Auth0, Supabase Auth, or just rolling my own.
For most of my projects I ended up rolling my own. Not because I think I&amp;rsquo;m smarter than the library authors, but because the libraries kept adding complexity I didn&amp;rsquo;t need. Magic session objects, callback URLs, provider configs, database adapters.</description></item><item><title>Prisma Tips I Wish I Knew From the Start</title><link>https://baransel.dev/post/prisma-tips-i-wish-i-knew-from-the-start/</link><pubDate>Wed, 04 Mar 2026 02:13:50 +0000</pubDate><guid>https://baransel.dev/post/prisma-tips-i-wish-i-knew-from-the-start/</guid><description>I switched to Prisma about two years ago and it immediately felt like the right choice. Type-safe queries, auto-generated types, easy migrations. Compared to writing raw SQL or fighting with other ORMs, it was a huge improvement.
But I also made a bunch of mistakes early on that cost me hours of debugging. Some were obvious in hindsight, some were things the docs don&amp;rsquo;t emphasize enough. Here&amp;rsquo;s everything I wish someone had told me when I started.</description></item><item><title>Writing Custom React Hooks That Actually Make Sense</title><link>https://baransel.dev/post/writing-custom-react-hooks-that-make-sense/</link><pubDate>Tue, 03 Mar 2026 02:13:50 +0000</pubDate><guid>https://baransel.dev/post/writing-custom-react-hooks-that-make-sense/</guid><description>Custom hooks confused me for a long time. I knew they existed. I knew they started with use. But every tutorial showed the same useless useCounter example and I never saw the point.
Then I started building real apps and kept copy-pasting the same logic between components. Debounce logic here, localStorage sync there, the same fetch-loading-error pattern everywhere. That&amp;rsquo;s when custom hooks clicked. They&amp;rsquo;re not about being clever. They&amp;rsquo;re about not repeating yourself.</description></item><item><title>Zod Is the Best Thing That Happened to My TypeScript Code</title><link>https://baransel.dev/post/zod-best-thing-happened-to-my-typescript/</link><pubDate>Mon, 02 Mar 2026 02:13:50 +0000</pubDate><guid>https://baransel.dev/post/zod-best-thing-happened-to-my-typescript/</guid><description>I spent years writing TypeScript and still had runtime errors caused by bad data. Types are great at compile time but they completely disappear at runtime. Your API could return anything, a form could submit garbage, and TypeScript wouldn&amp;rsquo;t save you.
So I wrote manual validation everywhere. if (!data.email) checks, typeof guards, nested conditions that made my code twice as long as it needed to be. It worked but it was tedious and I kept missing edge cases.</description></item><item><title>How I Structure Next.js Projects Without Losing My Mind</title><link>https://baransel.dev/post/how-i-structure-nextjs-projects/</link><pubDate>Sun, 01 Mar 2026 02:13:50 +0000</pubDate><guid>https://baransel.dev/post/how-i-structure-nextjs-projects/</guid><description>Every Next.js project I built used to end up the same way. Fifty files in the root, components scattered everywhere, and me spending more time finding things than building them.
The App Router made it worse at first because suddenly you had page.tsx, layout.tsx, loading.tsx, and error.tsx files everywhere. My project looked organized on the surface but I couldn&amp;rsquo;t find anything when I needed it.
After building probably a dozen Next.</description></item><item><title>Debugging is a Skill, Not a Talent</title><link>https://baransel.dev/post/debugging-is-a-skill-not-a-talent/</link><pubDate>Thu, 26 Feb 2026 02:13:50 +0000</pubDate><guid>https://baransel.dev/post/debugging-is-a-skill-not-a-talent/</guid><description>I used to think some developers were just naturally good at debugging. Like they had some kind of instinct for finding bugs that I didn&amp;rsquo;t have. They&amp;rsquo;d look at a broken feature, ask two questions, and find the problem in minutes while I was still adding console.log statements everywhere hoping something would make sense.
It took me a while to realize that debugging is a process, not a superpower. Those developers weren&amp;rsquo;t smarter.</description></item><item><title>Building APIs That Don't Make You Want to Quit</title><link>https://baransel.dev/post/building-apis-that-dont-make-you-want-to-quit/</link><pubDate>Wed, 25 Feb 2026 02:13:50 +0000</pubDate><guid>https://baransel.dev/post/building-apis-that-dont-make-you-want-to-quit/</guid><description>I&amp;rsquo;ve built a lot of APIs and I&amp;rsquo;ve also consumed a lot of terrible ones. The kind where every endpoint returns a different structure. Where error messages say &amp;ldquo;something went wrong&amp;rdquo; with no details. Where you need to read the source code to figure out what query parameters are supported.
After enough pain on both sides, I started following a few patterns that keep things simple and predictable. Nothing groundbreaking, just stuff that saves time and reduces frustration.</description></item><item><title>Lessons I Learned From Reading Other People's Code</title><link>https://baransel.dev/post/lessons-i-learned-from-reading-other-peoples-code/</link><pubDate>Tue, 24 Feb 2026 02:13:50 +0000</pubDate><guid>https://baransel.dev/post/lessons-i-learned-from-reading-other-peoples-code/</guid><description>Nobody really tells you to read other people&amp;rsquo;s code. Every learning resource is about writing code. Tutorials, courses, bootcamps, they all focus on output. Build this. Code that. Ship something.
But some of the biggest improvements in how I write code came from reading code that other people wrote. Open source projects, coworkers' pull requests, even random repos I found on GitHub while trying to solve a problem.
It&amp;rsquo;s uncomfortable at first.</description></item><item><title>The Stack I Use for Every New Project in 2026</title><link>https://baransel.dev/post/the-stack-i-use-for-every-new-project-2026/</link><pubDate>Mon, 23 Feb 2026 02:13:50 +0000</pubDate><guid>https://baransel.dev/post/the-stack-i-use-for-every-new-project-2026/</guid><description>Every year I see those &amp;ldquo;ultimate tech stack&amp;rdquo; posts and they always feel like someone listing every shiny tool they read about on Twitter. So instead of doing that, I want to share what I actually use when I start a new project. Not what I think is cool. What I reach for every time because it works and I trust it.
This isn&amp;rsquo;t going to be the right stack for everyone.</description></item><item><title>How I Stay Productive as a Solo Developer</title><link>https://baransel.dev/post/how-i-stay-productive-as-a-solo-developer/</link><pubDate>Sun, 22 Feb 2026 02:13:50 +0000</pubDate><guid>https://baransel.dev/post/how-i-stay-productive-as-a-solo-developer/</guid><description>Working alone is great until you realize nobody is going to tell you what to do next. No standup. No sprint board someone else filled in. No manager pinging you on Slack asking for an update. It&amp;rsquo;s just you, your editor, and a list of things that somehow keeps growing.
I&amp;rsquo;ve been working solo on projects for a while now, and I won&amp;rsquo;t pretend I have it all figured out. But I&amp;rsquo;ve found a few things that consistently help me stay on track without burning out or staring at my screen doing nothing for three hours.</description></item><item><title>Stop Overengineering Your Side Projects</title><link>https://baransel.dev/post/stop-overengineering-your-side-projects/</link><pubDate>Sat, 21 Feb 2026 02:13:50 +0000</pubDate><guid>https://baransel.dev/post/stop-overengineering-your-side-projects/</guid><description>I have a graveyard of unfinished projects. Seriously. If you looked at my old repos you&amp;rsquo;d find half-built dashboards, abandoned CLIs, and at least three &amp;ldquo;starter templates&amp;rdquo; that I spent weeks perfecting and never used for anything.
The pattern was always the same. I&amp;rsquo;d get excited about an idea, spend two days setting up the perfect folder structure, add linting, CI, Docker, maybe even a design system. And by the time I was &amp;ldquo;ready to start building&amp;rdquo; I&amp;rsquo;d already lost interest.</description></item><item><title>Why I Built GymDose: A Simple Supplement Tracker for Real Fitness Journeys</title><link>https://baransel.dev/post/why-i-built-gymdose/</link><pubDate>Tue, 02 Dec 2025 02:13:50 +0000</pubDate><guid>https://baransel.dev/post/why-i-built-gymdose/</guid><description>Why I Built GymDose: A Simple Supplement Tracker for Real Fitness Journeys Over the last couple of years, fitness has become a huge part of my life. I lost 45 kilograms through training, daily cardio, eating better, and staying consistent with my supplements. And even though I was motivated, there was one simple thing I kept messing up: I couldn’t remember which supplements I had taken each day.
Some mornings I’d double-dose my omega-3 without realizing.</description></item><item><title>How to Parse Solana Transactions Efficiently</title><link>https://baransel.dev/post/parse-solana-transactions-efficiently/</link><pubDate>Wed, 05 Nov 2025 02:13:50 +0000</pubDate><guid>https://baransel.dev/post/parse-solana-transactions-efficiently/</guid><description>Parsing transactions on Solana is one of those things that sounds simple, until you actually look at the raw JSON. Between preTokenBalances, innerInstructions, and all the account indices, it’s easy to get lost in the noise.
After building a few explorers and monitoring tools, I realized that the fastest way to handle Solana transactions isn’t about decoding everything — it’s about focusing on what changes.
Here’s the approach that works best for me.</description></item><item><title>TypeScript Tips for Cleaner, Safer Code</title><link>https://baransel.dev/post/typescript-tips-cleaner-safer-code/</link><pubDate>Wed, 24 Sep 2025 02:13:50 +0000</pubDate><guid>https://baransel.dev/post/typescript-tips-cleaner-safer-code/</guid><description>TypeScript Tips for Cleaner, Safer Code TypeScript helps you write fewer bugs and more reliable code. But it’s only as good as how you use it. Here are some practical tips.
1. Prefer unknown over any function parseJson(str: string): unknown { return JSON.parse(str); } unknown forces you to check types before use, unlike any.
2. Use type aliases and interfaces wisely Use type for unions and primitives. Use interface for objects and contracts.</description></item><item><title>Understanding Closures in JavaScript (With Real Examples)</title><link>https://baransel.dev/post/understanding-closures-in-javascript/</link><pubDate>Tue, 23 Sep 2025 02:13:50 +0000</pubDate><guid>https://baransel.dev/post/understanding-closures-in-javascript/</guid><description>Understanding Closures in JavaScript (With Real Examples) Closures confuse a lot of developers at first. But once you understand them, they unlock powerful patterns.
🧠 What is a closure? A closure happens when a function “remembers” variables from the scope where it was created — even after that scope has finished.
Example: Counter Function function createCounter() { let count = 0; return function() { count++; return count; }; } const counter = createCounter(); console.</description></item><item><title>React Performance Traps Every Developer Should Know</title><link>https://baransel.dev/post/react-performance-traps/</link><pubDate>Mon, 22 Sep 2025 02:13:50 +0000</pubDate><guid>https://baransel.dev/post/react-performance-traps/</guid><description>React Performance Traps Every Developer Should Know React is fast by default, but small mistakes can make components laggy. Let’s go through some common performance traps — and how to fix them.
1. Unnecessary re-renders function Button({ label }) { console.log(&amp;#34;rendering...&amp;#34;); return &amp;lt;button&amp;gt;{label}&amp;lt;/button&amp;gt;; } Every parent re-render will re-render the child, even if props didn’t change. ✅ Use React.memo for pure components.
2. Inline functions in JSX &amp;lt;button onClick={() =&amp;gt; doSomething()}&amp;gt;Click&amp;lt;/button&amp;gt; This creates a new function every render.</description></item><item><title>Mastering Async/Await in JavaScript: 7 Mistakes to Avoid</title><link>https://baransel.dev/post/mastering-async-await-javascript-mistakes/</link><pubDate>Sun, 21 Sep 2025 02:13:50 +0000</pubDate><guid>https://baransel.dev/post/mastering-async-await-javascript-mistakes/</guid><description>Mastering Async/Await in JavaScript: 7 Mistakes to Avoid Async/await changed the way we write JavaScript. No more messy callbacks, no endless .then() chains. But it’s not magic — misuse it, and you’ll still end up with bugs, performance issues, and confusion.
Let’s walk through 7 async/await mistakes I see all the time, and how to avoid them.
1. Forgetting to await async function fetchData() { const data = getUserData(); // missing await console.</description></item><item><title>10 Common JavaScript Pitfalls (and How to Avoid Them)</title><link>https://baransel.dev/post/10-common-javascript-pitfalls-how-to-avoid-them/</link><pubDate>Fri, 19 Sep 2025 02:13:50 +0000</pubDate><guid>https://baransel.dev/post/10-common-javascript-pitfalls-how-to-avoid-them/</guid><description>10 Common JavaScript Pitfalls (and How to Avoid Them) JavaScript is powerful, flexible, and everywhere — but that flexibility comes with traps. Even experienced devs fall into them. I want to share 10 common pitfalls I’ve seen (or hit myself), and how you can avoid each one. No fluff — just what works.
🎯 Why This Matters If you’ve been coding for a while, you’ve probably hit some strange bugs where the code “looked fine” but behaved completely differently.</description></item><item><title>TypeScript Type Narrowing: Writing Safer Code with Precision</title><link>https://baransel.dev/post/typescript-type-narrowing/</link><pubDate>Tue, 18 Feb 2025 02:13:50 +0000</pubDate><guid>https://baransel.dev/post/typescript-type-narrowing/</guid><description>TypeScript Type Narrowing: Writing Safer Code with Precision When working with TypeScript, you often deal with union types, meaning a variable can have multiple possible types. But how do you safely determine the actual type at runtime? This is where type narrowing comes in.
TypeScript narrowing means refining a variable’s type within a certain scope based on runtime checks. This allows the TypeScript compiler to provide better type inference and prevent unnecessary type errors.</description></item><item><title>TypeScript: JavaScript's Superhero Cape</title><link>https://baransel.dev/post/typescript-javascript-superhero-guide/</link><pubDate>Thu, 24 Oct 2024 02:13:50 +0000</pubDate><guid>https://baransel.dev/post/typescript-javascript-superhero-guide/</guid><description>Why Add Types to JavaScript? Picture this: You&amp;rsquo;re happily coding in JavaScript, when suddenly - &amp;ldquo;Cannot read property &amp;lsquo;name&amp;rsquo; of undefined&amp;rdquo;. Ugh, we&amp;rsquo;ve all been there! TypeScript is like having a friend who catches these mistakes before they happen.
The Origin Story JavaScript is like Peter Parker before the spider bite - great potential, but prone to accidents. TypeScript is the spider bite that gives JavaScript superpowers. It adds a type system that helps catch bugs early and makes your code more reliable.</description></item><item><title>Git Good: A Beginner's Guide to Version Control Magic</title><link>https://baransel.dev/post/beginners-guide-to-git-version-control/</link><pubDate>Tue, 03 Sep 2024 02:13:50 +0000</pubDate><guid>https://baransel.dev/post/beginners-guide-to-git-version-control/</guid><description>What&amp;rsquo;s All This Git About? Picture this: You&amp;rsquo;re working on a project, and suddenly you realize you&amp;rsquo;ve made a terrible mistake. Wouldn&amp;rsquo;t it be great if you could go back in time? Well, meet Git, your personal time machine for code!
Git is like a magical notebook that keeps track of every change you make to your project. It&amp;rsquo;s like having infinite &amp;ldquo;undo&amp;rdquo; buttons, each one taking you back to a different point in your project&amp;rsquo;s history.</description></item><item><title>Taming the Regex Beast: A Beginner's Guide to Regular Expressions</title><link>https://baransel.dev/post/beginners-guide-to-regular-expressions/</link><pubDate>Fri, 30 Aug 2024 02:13:50 +0000</pubDate><guid>https://baransel.dev/post/beginners-guide-to-regular-expressions/</guid><description>What&amp;rsquo;s This Regex Thing Anyway? Picture this: You&amp;rsquo;re sifting through a mountain of text, trying to find every email address. Sounds like a job for Ctrl+F, right? Well, not so fast! Enter regular expressions, or &amp;ldquo;regex&amp;rdquo; for short. It&amp;rsquo;s like Ctrl+F on steroids, capable of finding patterns instead of just exact matches.
Regex is like a Swiss Army knife for text processing. Need to validate email addresses? Regex. Want to extract all the URLs from a webpage?</description></item><item><title>Progressive Web Apps: The Future of Web Development</title><link>https://baransel.dev/post/progressive-web-apps-future-of-web-development/</link><pubDate>Thu, 29 Aug 2024 02:13:50 +0000</pubDate><guid>https://baransel.dev/post/progressive-web-apps-future-of-web-development/</guid><description>What&amp;rsquo;s All This PWA Buzz About? Picture this: You&amp;rsquo;re on the subway, trying to check a website on your phone, but the signal keeps dropping. Frustrating, right? Enter Progressive Web Apps, the superheroes of the web world. They work offline, load at lightning speed, and even send you notifications. It&amp;rsquo;s like giving your website superpowers!
The PWA Origin Story Back in the day (like, way back in 2015), we had a choice: build a website or build an app.</description></item><item><title>From Callback Chaos to Async Zen: A JavaScript Journey</title><link>https://baransel.dev/post/mastering-async-javascript-beginners-guide/</link><pubDate>Wed, 28 Aug 2024 02:13:50 +0000</pubDate><guid>https://baransel.dev/post/mastering-async-javascript-beginners-guide/</guid><description>The Asynchronous Challenge in JavaScript Picture this: You&amp;rsquo;re building a weather app. You need to fetch the user&amp;rsquo;s location, then use that to get the weather data, and finally display it on the screen. Sounds simple, right? Well, not so fast! Each of these steps takes time, and JavaScript, being the eager beaver it is, doesn&amp;rsquo;t like to wait around. Welcome to the world of asynchronous programming!
Callbacks: The OG of Async Back in the day, callbacks were the go-to solution for handling asynchronous operations.</description></item><item><title>Mastering TypeScript Generics: Enhancing Code Reusability and Type Safety</title><link>https://baransel.dev/post/mastering-typescript-generics-enhancing-code-reusability-and-type-safety/</link><pubDate>Fri, 16 Aug 2024 02:13:50 +0000</pubDate><guid>https://baransel.dev/post/mastering-typescript-generics-enhancing-code-reusability-and-type-safety/</guid><description>TypeScript has revolutionized the way we write JavaScript, bringing static typing and enhanced tooling to our development process. One of its most powerful features is generics, which allow us to create reusable components that work with a variety of types. In this post, we&amp;rsquo;ll dive deep into TypeScript generics, exploring how they can improve your code&amp;rsquo;s flexibility and type safety.
Understanding Generics Generics provide a way to create components that can work over a variety of types rather than a single one.</description></item><item><title>Advanced Techniques with React and TypeScript</title><link>https://baransel.dev/post/advanced-react-typescript-techniques/</link><pubDate>Wed, 17 Apr 2024 02:13:50 +0000</pubDate><guid>https://baransel.dev/post/advanced-react-typescript-techniques/</guid><description>Introduction Building on our previous exploration of basic React components with TypeScript, this post delves into more advanced techniques. Learn to create more complex component patterns and master state management to elevate your React applications.
Using Higher-Order Components Higher-order components (HOCs) are functions that take a component and return a new component. They&amp;rsquo;re ideal for reusing component logic. Here’s how you can create a simple HOC that adds additional props to a component:</description></item><item><title>Building Your First React Component with TypeScript</title><link>https://baransel.dev/post/react-typescript-first-component/</link><pubDate>Wed, 28 Feb 2024 02:13:50 +0000</pubDate><guid>https://baransel.dev/post/react-typescript-first-component/</guid><description>React and TypeScript together offer a powerful combination for building robust web applications. This post will guide you through creating your first React component with TypeScript, ensuring type safety and enhancing developer productivity.
Setting Up Your Environment Before diving into component creation, ensure your environment is set up for React and TypeScript:
npx create-react-app my-app --template typescript cd my-app npm start Creating a Typed React Component Let&amp;rsquo;s create a simple Greeting component that accepts a name prop:</description></item><item><title>TypeScript: Destructuring Objects with Types</title><link>https://baransel.dev/post/typescript-destructuring-objects-with-types/</link><pubDate>Wed, 31 Jan 2024 02:13:50 +0000</pubDate><guid>https://baransel.dev/post/typescript-destructuring-objects-with-types/</guid><description>Recently, I ran into a little issue while using TypeScript in a project. I was trying to pull out some values from an object, something I&amp;rsquo;ve done a bunch of times. But this time, I wanted to make sure those values were the right type.
Here&amp;rsquo;s what I started with:
const { title, pages } = bookDetails; I thought I could just slap the types right in there like this:</description></item><item><title>A simple React app: fetch GitHub users information via API</title><link>https://baransel.dev/post/react-simple-github-fetch-user/</link><pubDate>Fri, 12 Jan 2024 02:13:50 +0000</pubDate><guid>https://baransel.dev/post/react-simple-github-fetch-user/</guid><description>Welcome to a quick tutorial on my journey of building a React app that connects with external APIs. Today, I&amp;rsquo;m focusing on a hands-on example: fetching and displaying GitHub user data using GitHub&amp;rsquo;s public API. This project is ideal for anyone looking to grasp API integration in React, whether you&amp;rsquo;re starting out or brushing up your skills.
I&amp;rsquo;ll walk you through setting up the React environment, exploring the GitHub API, and creating a user interface for displaying the data.</description></item><item><title>Web Performance Optimization: Boosting Page Speed and Enhancing User Experience</title><link>https://baransel.dev/post/web-performance-optimization-tips/</link><pubDate>Fri, 05 Jan 2024 02:13:50 +0000</pubDate><guid>https://baransel.dev/post/web-performance-optimization-tips/</guid><description>In today&amp;rsquo;s fast-paced digital world, where attention spans are short and competition is fierce, web performance optimization is not just an option—it&amp;rsquo;s a necessity. Visitors expect websites to load quickly and provide a seamless browsing experience. A sluggish website not only frustrates users but also affects your search engine rankings. In this comprehensive guide, we&amp;rsquo;ll delve into the importance of web performance and provide actionable tips to boost page speed and enhance the overall user experience.</description></item><item><title>10 Essential Concepts Every Developer Should Know</title><link>https://baransel.dev/post/ten-javascript-concepts-every-developer-should-know/</link><pubDate>Fri, 15 Dec 2023 02:13:50 +0000</pubDate><guid>https://baransel.dev/post/ten-javascript-concepts-every-developer-should-know/</guid><description>1. Call Stack The call stack is a vital part of JavaScript&amp;rsquo;s execution model. It keeps track of function calls, ensuring they are executed in the correct order. When a function is called, it&amp;rsquo;s pushed onto the stack, and when it returns, it&amp;rsquo;s popped off. This stack helps maintain the program&amp;rsquo;s execution flow.
2. Primitive Types JavaScript has six primitive data types: numbers, strings, booleans, null, undefined, and symbols. These types represent simple values and are immutable, meaning their values cannot be changed.</description></item><item><title>Elevate Your Code: 5 Must-Have Websites Every Developer Should Know</title><link>https://baransel.dev/post/elevate-code-essential-developer-websites/</link><pubDate>Thu, 07 Dec 2023 02:13:50 +0000</pubDate><guid>https://baransel.dev/post/elevate-code-essential-developer-websites/</guid><description>Today, I&amp;rsquo;m excited to share five exceptional websites that have become indispensable in my project development toolkit. These platforms not only save time but also offer valuable resources to enhance your coding endeavours. Let&amp;rsquo;s dive in!
1️⃣ DevDocs - The Ultimate Documentation Hub DevDocs is your one-stop-shop for comprehensive developer documentation. Bringing together documentation for various programming languages and frameworks, it&amp;rsquo;s a go-to resource for quick access to essential information.</description></item><item><title>Junior to Senior Developer Guide: Navigating the Evolution of Your Coding Journey</title><link>https://baransel.dev/post/junior-to-senior-developer-guide/</link><pubDate>Sun, 19 Nov 2023 02:13:50 +0000</pubDate><guid>https://baransel.dev/post/junior-to-senior-developer-guide/</guid><description>Embarking on the path of a junior developer is akin to stepping onto a vast and thrilling landscape of coding possibilities. As you traverse this realm, transitioning from a junior to a senior developer is a natural evolution marked by continuous learning and strategic skill development. In this roadmap, we&amp;rsquo;ll navigate through practical examples and actionable advice to guide aspiring developers on their transformative journey.
1. Mastering the Foundations: Building Strong Code Fundamentals In your junior phase, prioritize mastering the essentials – programming languages, data structures, and algorithms.</description></item><item><title>MongoDB Best Practices: Optimizing Performance and Schema Design</title><link>https://baransel.dev/post/mongodb-best-practices/</link><pubDate>Tue, 14 Nov 2023 02:13:50 +0000</pubDate><guid>https://baransel.dev/post/mongodb-best-practices/</guid><description>MongoDB, a powerful NoSQL database, offers flexibility and scalability. To harness its full potential, follow these best practices for optimizing performance and designing efficient schemas.
1. Indexing Strategies Best Practice: Create appropriate indexes to speed up query performance.
Example:
// Create an index on the &amp;#39;username&amp;#39; field db.users.createIndex({ username: 1 }); 2. Understand and Leverage Sharding Best Practice: Distribute data across shards for horizontal scalability.
Example:
// Enable sharding for a specific database sh.</description></item><item><title>Mastering Git: Essential Tips and Best Practices for Developers</title><link>https://baransel.dev/post/mastering-git-tips-best-practices/</link><pubDate>Fri, 10 Nov 2023 02:13:50 +0000</pubDate><guid>https://baransel.dev/post/mastering-git-tips-best-practices/</guid><description>Git is a cornerstone of modern software development, providing powerful version control and collaboration capabilities. Whether you&amp;rsquo;re a beginner or an experienced developer, mastering Git is essential for efficient project management. In this article, we&amp;rsquo;ll explore key tips and best practices to help you elevate your Git skills and streamline your development workflow.
1. Commit Early and Often Frequent, smaller commits make it easier to track changes and understand the project&amp;rsquo;s evolution.</description></item><item><title>Effective Code Documentation: Best Practices for Developers</title><link>https://baransel.dev/post/effective-code-documentation/</link><pubDate>Tue, 07 Nov 2023 02:13:50 +0000</pubDate><guid>https://baransel.dev/post/effective-code-documentation/</guid><description>Good documentation is the backbone of any successful software project. Whether you&amp;rsquo;re a seasoned developer or just starting, mastering the art of code documentation is essential. In this article, we&amp;rsquo;ll explore best practices for code documentation, backed by real-world examples, to help you create efficient and well-documented software projects.
1. Write Meaningful Comments Comments should be clear and concise, explaining the &amp;lsquo;why&amp;rsquo; rather than the &amp;lsquo;what.&amp;rsquo; For example, consider this comment:</description></item><item><title>TypeScript Best Practices: Writing Clean and Maintainable Code</title><link>https://baransel.dev/post/typescript-best-practices/</link><pubDate>Fri, 03 Nov 2023 02:13:50 +0000</pubDate><guid>https://baransel.dev/post/typescript-best-practices/</guid><description>TypeScript is a powerful language for web development, offering type safety and improved code quality. To make the most of it, you need to follow best practices. In this article, we&amp;rsquo;ll explore essential TypeScript best practices for writing clean and maintainable code, helping you become a more proficient developer.
1. Use Descriptive Variable and Function Names Clarity is crucial in code. Use descriptive names for variables and functions to enhance readability.</description></item><item><title>TypeScript Generics Demystified: Unlocking the Power of Parametric Polymorphism</title><link>https://baransel.dev/post/typescript-generics-demystified/</link><pubDate>Mon, 30 Oct 2023 02:13:50 +0000</pubDate><guid>https://baransel.dev/post/typescript-generics-demystified/</guid><description>TypeScript Generics Demystified: Unlocking the Power of Parametric Polymorphism When it comes to writing versatile and reusable code, TypeScript generics are your secret weapon. Generics allow you to create flexible and type-safe functions, classes, and data structures. In this article, we&amp;rsquo;ll demystify TypeScript generics with real-world examples, helping you unlock the full potential of parametric polymorphism in your projects.
Understanding Generics What Are Generics?
Generics are a way to create components that work with a variety of data types, rather than a single specific type.</description></item><item><title>TypeScript vs. JavaScript: Making the Right Choice for Your Project</title><link>https://baransel.dev/post/typescript-vs-javascript-examples/</link><pubDate>Sun, 29 Oct 2023 02:13:50 +0000</pubDate><guid>https://baransel.dev/post/typescript-vs-javascript-examples/</guid><description>TypeScript vs. JavaScript: Making the Right Choice for Your Project Choosing the right programming language is a critical decision for any software project. When it comes to web development, JavaScript has long been the go-to language for creating dynamic and interactive web applications. However, in recent years, TypeScript has gained prominence as a valuable alternative. In this article, we&amp;rsquo;ll compare TypeScript and JavaScript, highlighting the differences between these two languages through real-world examples to help you make an informed choice for your next project.</description></item><item><title>Mastering TypeScript: A Beginner's Guide</title><link>https://baransel.dev/post/typescript-beginners-guide/</link><pubDate>Fri, 27 Oct 2023 02:13:50 +0000</pubDate><guid>https://baransel.dev/post/typescript-beginners-guide/</guid><description>Mastering TypeScript: A Beginner&amp;rsquo;s Guide Are you a JavaScript developer seeking to level up your coding game and create more reliable and maintainable projects? TypeScript might be the answer. TypeScript is a superset of JavaScript that introduces static typing, interfaces, and advanced development tooling. In this beginner&amp;rsquo;s guide, we&amp;rsquo;ll dive deeper into TypeScript, explore its features, and discuss why it can be a game-changer in your development journey.
A Closer Look at TypeScript TypeScript: A Language with Static Types</description></item><item><title>JavaScript ES6 Features Every Developer Should Know</title><link>https://baransel.dev/post/javascript-es6-features/</link><pubDate>Thu, 26 Oct 2023 02:13:50 +0000</pubDate><guid>https://baransel.dev/post/javascript-es6-features/</guid><description>JavaScript ES6 Features Every Developer Should Know JavaScript is constantly evolving, and ECMAScript 6 (ES6) brought a wealth of new features that can supercharge your coding experience. In this article, we&amp;rsquo;ll delve into some of the key ES6 features that are essential knowledge for every JavaScript developer. From arrow functions to promises, these tools will help you write cleaner, more efficient code and elevate your JavaScript skills to the next level.</description></item><item><title>Javascript use strict</title><link>https://baransel.dev/post/javascript-use-strict/</link><pubDate>Sat, 29 Jul 2023 02:13:50 +0000</pubDate><guid>https://baransel.dev/post/javascript-use-strict/</guid><description>Welcome to an exciting exploration of the use strict directive in JavaScript! In this blog post, we will delve into the magical world of strict mode and how it can supercharge your JavaScript code, leading to better performance, improved debugging, and a more robust application. Let&amp;rsquo;s embark on this journey of discovery together and unravel the wonders of use strict through engaging code examples.
What is use strict? Before we dive into the practical examples, let&amp;rsquo;s briefly understand what use strict is all about.</description></item><item><title>Solving hCaptcha with Puppeteer and Python</title><link>https://baransel.dev/post/how-to-bypass-hcaptcha/</link><pubDate>Tue, 18 Jul 2023 02:13:50 +0000</pubDate><guid>https://baransel.dev/post/how-to-bypass-hcaptcha/</guid><description>Disclaimer: This information is for educational purposes only.
What does Captcha mean? Captcha mechanisms have become an integral part of web security, ensuring that the interaction between humans and websites remains genuine. However, as web developers and automation enthusiasts, we often encounter challenges when trying to bypass captchas programmatically. In this blog post, we will explore an effective solution using Puppeteer and Python in combination with CapSolver, a powerful captcha-solving service.</description></item><item><title>Introduction to JavaScript Error Handling</title><link>https://baransel.dev/post/javascript-error-handling/</link><pubDate>Wed, 05 Apr 2023 02:13:50 +0000</pubDate><guid>https://baransel.dev/post/javascript-error-handling/</guid><description>The try Statement The try statement allows you to define a block of code to be tested for errors. If an error occurs within the block of code, the JavaScript interpreter stops executing the block of code and jumps to the catch statement. Here&amp;rsquo;s an example:
try { // Code that may throw an error } catch (error) { // Code to handle the error } In this example, the try statement contains the code that may throw an error.</description></item><item><title>Introduction to JavaScript Regular Expressions</title><link>https://baransel.dev/post/javascript-regular-expressions/</link><pubDate>Thu, 30 Mar 2023 02:13:50 +0000</pubDate><guid>https://baransel.dev/post/javascript-regular-expressions/</guid><description>Creating Regular Expressions In JavaScript, regular expressions are created using the RegExp object or by using the shorthand notation of enclosing the pattern between two slashes (/pattern/). Here&amp;rsquo;s an example of using the shorthand notation to create a regular expression:
const regex = /hello/; In this example, the regular expression matches the string &amp;ldquo;hello&amp;rdquo;.
Matching Text To match text using a regular expression in JavaScript, you can use the test() method.</description></item><item><title>Introduction to JavaScript Type Conversions</title><link>https://baransel.dev/post/javascript-type-conversions/</link><pubDate>Mon, 27 Mar 2023 02:13:50 +0000</pubDate><guid>https://baransel.dev/post/javascript-type-conversions/</guid><description>Implicit Type Conversions JavaScript performs implicit type conversions automatically when it tries to operate on values of different types. For example, if you try to add a string and a number together, JavaScript will convert the number to a string and then concatenate the two strings together. Here&amp;rsquo;s an example:
var str = &amp;#34;Hello&amp;#34;; var num = 123; var result = str + num; console.log(result); // &amp;#34;Hello123&amp;#34; In this example, the number 123 is implicitly converted to the string &amp;quot;123&amp;quot; so that it can be concatenated with the string &amp;quot;Hello&amp;quot;.</description></item><item><title>Getting Started with JavaScript Loops: A Beginner's Guide</title><link>https://baransel.dev/post/javascript-loops/</link><pubDate>Thu, 16 Feb 2023 02:13:50 +0000</pubDate><guid>https://baransel.dev/post/javascript-loops/</guid><description>The For Loop The for loop is used to execute a block of code a specific number of times. It consists of three statements: initialization, condition, and increment. Here&amp;rsquo;s an example of a for loop that will print the numbers 1 to 10:
for (var i = 1; i &amp;lt;= 10; i++) { console.log(i); } In this example, the variable i is initialized to 1. The loop will continue as long as i is less than or equal to 10.</description></item><item><title>Getting Started with JavaScript Switch Case: A Beginner's Guide</title><link>https://baransel.dev/post/javascript-switch-cases/</link><pubDate>Tue, 14 Feb 2023 02:13:50 +0000</pubDate><guid>https://baransel.dev/post/javascript-switch-cases/</guid><description>JavaScript is a popular programming language used to create interactive websites and web applications. One of the most useful features of JavaScript is the switch case statement, which allows developers to compare a variable to multiple values in a concise and organized way. In this guide, we&amp;rsquo;ll cover the basics of the switch case statement in JavaScript and provide some examples to help you get started.
What is a Switch Case Statement?</description></item><item><title>A Comprehensive Guide to Getting Started with PHP: Tips, Tricks, and Code Examples</title><link>https://baransel.dev/post/getting-started-with-php/</link><pubDate>Wed, 08 Feb 2023 02:13:50 +0000</pubDate><guid>https://baransel.dev/post/getting-started-with-php/</guid><description>Basic Syntax Before we dive into the tips and tricks, let&amp;rsquo;s go over the basic syntax of PHP. Here&amp;rsquo;s a simple example that outputs &amp;ldquo;Hello, World!&amp;rdquo; to the screen:
&amp;lt;?php echo &amp;#34;Hello, World!&amp;#34;; ?&amp;gt;As you can see, PHP code is enclosed in \&amp;lt;?php and ?&amp;gt; tags. You can place PHP code anywhere within your HTML file.
Data Types In PHP, there are several data types you can use to store and manipulate data.</description></item><item><title>Installing PHP 8 on CentOS 7: A Comprehensive Guide</title><link>https://baransel.dev/post/how-to-install-php8-on-centos/</link><pubDate>Sun, 05 Feb 2023 02:13:50 +0000</pubDate><guid>https://baransel.dev/post/how-to-install-php8-on-centos/</guid><description>Prerequisites Before installing PHP 8 on CentOS 7, you must have the EPEL (Extra Packages for Enterprise Linux) repository installed. You can install it by running the following command:
sudo yum install epel-release Installing PHP 8 on CentOS 7 To install PHP 8 on CentOS 7, follow these steps:
Add the Remi repository to your system. This repository provides updated versions of PHP for various Linux distributions: sudo yum install https://dl.</description></item><item><title>Getting Started with PHP 8 on Ubuntu: A Step-by-Step Guide</title><link>https://baransel.dev/post/how-to-install-php8-on-ubuntu/</link><pubDate>Sat, 04 Feb 2023 02:13:50 +0000</pubDate><guid>https://baransel.dev/post/how-to-install-php8-on-ubuntu/</guid><description>Installing PHP 8 on Ubuntu 18.04 To install PHP 8 on Ubuntu 18.04, follow these steps:
Update your system&amp;rsquo;s package list by running the following command: sudo apt-get update Add the Ondřej Surý PPA to your system. This PPA provides updated versions of PHP for various Ubuntu releases: sudo apt-get install software-properties-common sudo add-apt-repository ppa:ondrej/php Update the package list again to reflect the changes made in step 2: sudo apt-get update Finally, install PHP 8 by running the following command: sudo apt-get install php8.</description></item><item><title>5 Tips for Optimizing Your PHP Code</title><link>https://baransel.dev/post/php-5-tips-for-optimizing/</link><pubDate>Fri, 03 Feb 2023 02:13:50 +0000</pubDate><guid>https://baransel.dev/post/php-5-tips-for-optimizing/</guid><description>1. Use the Right Data Types By using the appropriate data types, you can increase the performance of your PHP code. For example, using an integer instead of a string for a number can improve performance and reduce memory usage.
&amp;lt;?php // Correct Usage $age = 25; // Incorrect Usage $age = &amp;#34;25&amp;#34;; ?&amp;gt;2. Avoid Using Unnecessary Variables Minimizing the number of variables in your code can help improve performance. Use variables only when they are necessary, and re-use them when possible.</description></item><item><title>JavaScript Scopes</title><link>https://baransel.dev/post/javascript-scopes/</link><pubDate>Thu, 26 Jan 2023 02:13:50 +0000</pubDate><guid>https://baransel.dev/post/javascript-scopes/</guid><description>The scope of activity is the use of variables. The scope of a variable is the region of your program in which you can access the variable, by using its name. The scope of a variable determines the visibility of that variable. Variables defined inside a function are not visible (or have no scope) from outside the function.
Scope Area Functions and objects defined with JavaScript are declared as variables.</description></item><item><title>Javascript Objects</title><link>https://baransel.dev/post/javascript-objects/</link><pubDate>Tue, 22 Nov 2022 02:13:50 +0000</pubDate><guid>https://baransel.dev/post/javascript-objects/</guid><description>In real life, a car is an object.
The car has functions such as: start, drive, stop and properties such as: weight, color and model.
Object Properties Functions CAR car.brand = BMW car.model = 420d car.weight = 1475kg car.color = black car.start() car.drive() car.break() car.stop() All cars have similar characteristics however, property values vary from car to car. All cars have similar functions.</description></item><item><title>Javascript Functions</title><link>https://baransel.dev/post/javascript-functions/</link><pubDate>Fri, 02 Sep 2022 02:13:50 +0000</pubDate><guid>https://baransel.dev/post/javascript-functions/</guid><description>A function written in JavaScript is a block of code designed to perform a specific action.
Executes when a function written in JavaScript is called.
function add(number1, number2) { return number1 + number2; } console.log(add(10, 5)); Creating a function The function keyword is defined by a space function name and parentheses.
Function names can contain letters, numbers, underscores, and dollar signs. (same as variable definition rules)
Multiple parameters are separated by commas in parentheses.</description></item><item><title>Javascript Variables</title><link>https://baransel.dev/post/javascript-variables/</link><pubDate>Sat, 13 Aug 2022 02:13:50 +0000</pubDate><guid>https://baransel.dev/post/javascript-variables/</guid><description>In Javascript, variables are used to store data.
In the example, variables a, b, and c are defined and assigned values.
var a = 5; var b = 6; var c = a + b; Defined variables:
The value of a variable is 5 The value of variable b is 6 The value of variable c becomes 11. Variable definition All Javascript variable names must be unique.</description></item><item><title>Javascript Comments</title><link>https://baransel.dev/post/javascript-comments/</link><pubDate>Sat, 06 Aug 2022 02:13:50 +0000</pubDate><guid>https://baransel.dev/post/javascript-comments/</guid><description>There are comments and information about the comment line used to explain the JavaScript codes or disable the execution of the codes.
JavaScript&amp;rsquo;s comments are used to explain written JavaScript codes and increase code readability.
Comment line Single-line comments begin with two slashes //.
The two slashes after // will be interpreted as a comment line and will not be executed by JavaScript.
In the example, before each JavaScript code, information about what the code will do is given as a comment.</description></item><item><title>Basic rules of Javascript</title><link>https://baransel.dev/post/basic-rules-of-javascript/</link><pubDate>Sat, 30 Jul 2022 02:13:50 +0000</pubDate><guid>https://baransel.dev/post/basic-rules-of-javascript/</guid><description>There is rules that should be considered when developing with JavaScript.
A computer program is instructions written for processing by the computer.
There are different rules for each programming language when writing instructions.
Spelling rules are called syntax.
The smallest piece of code that performs a certain action in JavaScript commands is called code.
JavaScript codes are terminated with semicolons.
var a, b, c; a = 5; b = 6; c = a + b; JavaScript code consists of variables, operators, statements, keywords, and comments.</description></item><item><title>How to print Javascript</title><link>https://baransel.dev/post/how-to-print-javascript/</link><pubDate>Mon, 25 Jul 2022 02:13:50 +0000</pubDate><guid>https://baransel.dev/post/how-to-print-javascript/</guid><description>In order to see the result of calculations made with JavaScript, the value of variables or any data, we need to print it on the screen.
Printing to the screen;
Printing to HTML objects – innerHTML, Printing to HTML page – document.write(), Printing to the alert window – alert(), Printing to the browser console – console.log() Using innerHTML The document.getElementById(ID) method is often used to select HTML objects with JavaScript.</description></item><item><title>How to run Javascript</title><link>https://baransel.dev/post/how-to-run-javascript/</link><pubDate>Sat, 23 Jul 2022 02:13:50 +0000</pubDate><guid>https://baransel.dev/post/how-to-run-javascript/</guid><description>Since JavaScript commands run on the browser, we need to add JavaScript codes to our web page.
There are various methods of adding JavaScript code to a web page.
JavaScript codes can be written between the &amp;lt;script&amp;gt; and &amp;lt;/script&amp;gt; tags.
&amp;lt;script&amp;gt; alert(&amp;#34;baransel.dev&amp;#34;); &amp;lt;/script&amp;gt; It can be written to HTML properties such as onclick, which indicates when the HTML element is clicked, onmouseover, which indicates that the HTML element is hovered.</description></item><item><title>hostname Command in CLI</title><link>https://baransel.dev/post/cli-hostname-command/</link><pubDate>Fri, 10 Jun 2022 02:13:50 +0000</pubDate><guid>https://baransel.dev/post/cli-hostname-command/</guid><description>You can find and set the name of your computer to make it easier for people to discover on a network using the hostname command.
hostname You will get a result saying your computer name and in my case it says baransel.local
The first part of the result is the name of the computer and the second part is the name of the domain.
hostname -s You can run the command above to return just the computer name.</description></item><item><title>zip, unzip Command in CLI</title><link>https://baransel.dev/post/cli-zip-unzip-command/</link><pubDate>Thu, 09 Jun 2022 02:13:50 +0000</pubDate><guid>https://baransel.dev/post/cli-zip-unzip-command/</guid><description>Use the zip command to compress the files into a zip file, and the unzip command to extract the compressed files from a zip archive.
zip Command To compress file zip -r file.zip file_or_folder Compresses folders and/or files and turns them into file.zip.
unzip Command The unzip command has a really simple syntax (see below). If you use it to extract a zip file without any options, it will extract all the files in the current directory.</description></item><item><title>echo Command in CLI</title><link>https://baransel.dev/post/cli-echo-command/</link><pubDate>Sun, 05 Jun 2022 02:13:50 +0000</pubDate><guid>https://baransel.dev/post/cli-echo-command/</guid><description>With the Linux echo command, we can output the text we want to the terminal screen, or we can use it to create a new file.
Create file To create a file with the echo command, a greater than sign is placed after the echo command and the file name is written after the sign. When we look at the format, we see that it is similar to the cat command in terms of usage.</description></item><item><title>Listing previously entered commands in CLI</title><link>https://baransel.dev/post/cli-history-command/</link><pubDate>Fri, 03 Jun 2022 02:13:50 +0000</pubDate><guid>https://baransel.dev/post/cli-history-command/</guid><description>All commands run in Linux are archived in a file and you can see these commands with the history command when you need it.
The History archive is also stored in a file that you can modify. Bash shell users can find their history in the .bash_history file in their home directory (cd ~).
The file where the archive will be kept is kept in the $HISTFILE variable. If desired, this variable can be edited from the .</description></item><item><title>📰 Weekly Newsletter #5 - 27 May 2022</title><link>https://baransel.dev/newsletters/27-05-2022/</link><pubDate>Fri, 27 May 2022 00:00:00 +0000</pubDate><guid>https://baransel.dev/newsletters/27-05-2022/</guid><description>Read this on baransel.dev
Around the Web 📓 Recent blog posts top Command in CLI 📝 Articles Wouldn’t life be more fun if charging bricks looked like tiny Macintosh computers? After buying Bungie, Sony goes all in on live service games 💻 Projects GameShell beats lens ✍️ Quote of the week “Sometimes the biggest act of courage is a small one.” - Lauren Raffo</description></item><item><title>top Command in CLI</title><link>https://baransel.dev/post/cli-top-command/</link><pubDate>Tue, 24 May 2022 02:13:50 +0000</pubDate><guid>https://baransel.dev/post/cli-top-command/</guid><description>The top command, which is a counterpart of the Task Manager in Windows, will show a list of running programs and how much CPU these programs are using. Monitoring system resource usage is very useful and will help you, especially if you are able to terminate programs that are using too much system resource.
q will quit the top command. c Sorts by CPU processing time. The order is from largest to smallest.</description></item><item><title>📰 Weekly Newsletter #4 - 20 May 2022</title><link>https://baransel.dev/newsletters/20-05-2022/</link><pubDate>Fri, 20 May 2022 00:00:00 +0000</pubDate><guid>https://baransel.dev/newsletters/20-05-2022/</guid><description>Read this on baransel.dev
Around the Web 📓 Recent blog posts uname Command in CLI Downlading files from the internet in CLI 📝 Articles Amazon hardware exec takes another swipe at Zuckerberg’s metaverse fantasy Critical Vulnerability in Premium WordPress Themes Allows for Site Takeover 💻 Projects remix CodeEdit gin ✍️ Quote of the week “The future is an opaque mirror. Anyone who tries to look into it sees nothing but the dim outlines of an old and worried face.</description></item><item><title>uname Command in CLI</title><link>https://baransel.dev/post/cli-uname-command/</link><pubDate>Wed, 18 May 2022 02:13:50 +0000</pubDate><guid>https://baransel.dev/post/cli-uname-command/</guid><description>The uname command, abbreviated as Unix Name, gives information about your Linux system such as machine name, operating system, kernel, etc.
uname -a All information that can be printed is printed on the screen.
Linux baransel.dev 3.10.0-1160.el7.x86_64 #1 SMP Mon Oct 19 16:18:59 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux uname -s It prints the kernel name in use to the screen.
Linux uname -n Shows the host name of your computer used in the network.</description></item><item><title>Downlading files from the internet in CLI</title><link>https://baransel.dev/post/cli-downloading-files-from-internet/</link><pubDate>Mon, 16 May 2022 02:13:50 +0000</pubDate><guid>https://baransel.dev/post/cli-downloading-files-from-internet/</guid><description>Linux commands are very useful. You can even download files from the Internet with the help of the wget command. To do this, enter wget and then the link of the file you want to download.
wget https://baransel.dev/images/profile.png Output:
--2022-05-16 11:43:17-- https://baransel.dev/images/profile.png Resolving baransel.dev (baransel.dev)... 3.67.153.12, 3.67.234.155 Connecting to baransel.dev (baransel.dev)|3.67.153.12|:443... connected. HTTP request sent, awaiting response... 200 OK Length: 23911 (23K) [image/png] Saving to: ‘profile.png’ profile.png 100%[===================&amp;gt;] 23.35K --.-KB/s in 0.</description></item><item><title>📰 Weekly Newsletter #3 - 13 May 2022</title><link>https://baransel.dev/newsletters/13-05-2022/</link><pubDate>Fri, 13 May 2022 00:00:00 +0000</pubDate><guid>https://baransel.dev/newsletters/13-05-2022/</guid><description>Read this on baransel.dev
Around the Web 📓 Recent blog posts ping Command in CLI How to Terminate a process in CLI chown Command in CLI Comparing files in CLI 📝 Articles Crypto winter is coming Twitter CEO Pushes Out Top Execs, Freezes Hiring Elon Musk says he would reverse Twitter&amp;rsquo;s Trump ban 💻 Projects ntfy starlette flutter/pinball ✍️ Quote of the week “When it is obvious that the goals cannot be reached, don&amp;rsquo;t adjust the goals, adjust the action steps.</description></item><item><title>ping Command in CLI</title><link>https://baransel.dev/post/cli-ping-process/</link><pubDate>Thu, 12 May 2022 02:13:50 +0000</pubDate><guid>https://baransel.dev/post/cli-ping-process/</guid><description>Use the ping command to check your connection to a server.
For example, by entering this command in the terminal:
ping google.com You can find out whether you can connect to Google and measure the response time.</description></item><item><title>How to Terminate a process in CLI</title><link>https://baransel.dev/post/cli-how-to-terminate-process/</link><pubDate>Tue, 10 May 2022 02:13:50 +0000</pubDate><guid>https://baransel.dev/post/cli-how-to-terminate-process/</guid><description>If there is a program that is not responding, you can manually terminate the program by using the kill command. This command will send a specific signal to the unresponsive application and instruct the application to terminate itself.
There are forty-six signals in total that you can use, but generally these two signals are used:
SIGTERM (15) — prompts a program to stop running and gives it some time to save its state.</description></item><item><title>chown Command in CLI</title><link>https://baransel.dev/post/cli-chown-command/</link><pubDate>Mon, 09 May 2022 02:13:50 +0000</pubDate><guid>https://baransel.dev/post/cli-chown-command/</guid><description>In Linux, all files have a specific owner.
The chown command is used to transfer ownership of a file to a specific user.
For example:
chown baransel random.txt This will make baransel the owner of random.txt
You can use the ls -l command to confirm the ownership change.
This will give the following output:
-rw-r--r-- 1 baransel staff 0 May 9 14:48 random.txt</description></item><item><title>Comparing files in CLI</title><link>https://baransel.dev/post/cli-comparing-files/</link><pubDate>Fri, 06 May 2022 02:13:50 +0000</pubDate><guid>https://baransel.dev/post/cli-comparing-files/</guid><description>The diff command, short for difference, compares the contents of two files line by line. After analyzing the files, it will return the lines that do not match as a result. Programmers often use this command to make changes to the program, rather than rewrite the entire source code.
The simplest form of this command is:
diff file1.ext file2.ext</description></item><item><title>📰 Weekly Newsletter #2 - 6 May 2022</title><link>https://baransel.dev/newsletters/06-05-2022/</link><pubDate>Fri, 06 May 2022 00:00:00 +0000</pubDate><guid>https://baransel.dev/newsletters/06-05-2022/</guid><description>Read this on baransel.dev
Around the Web 📓 Recent blog posts tail Command in CLI head Command in CLI grep Command in CLI 📝 Articles Twitter rolls out new Spaces features, including access to analytics for hosts Former WhatsApp exec regrets selling the app to Facebook The Crypto Industry Is Getting Too Honest 💻 Projects gitpod.io autin pyscript ✍️ Quote of the week “Speak when you are angry and you will make the best speech you will ever regret.</description></item><item><title>tail Command in CLI</title><link>https://baransel.dev/post/cli-tail-command/</link><pubDate>Thu, 05 May 2022 02:13:50 +0000</pubDate><guid>https://baransel.dev/post/cli-tail-command/</guid><description>This command has a similar function to the head command. Instead of showing the first lines, the tail command will display the last ten lines of a text file.
For example:
tail file.txt The -n parameter is used to specify the number of lines to display.
tail -n 30 file.txt</description></item><item><title>head Command in CLI</title><link>https://baransel.dev/post/cli-head-command/</link><pubDate>Mon, 02 May 2022 02:13:50 +0000</pubDate><guid>https://baransel.dev/post/cli-head-command/</guid><description>The head command is used to display the first line of any text file. By default, the first ten lines will be displayed, but you can change this number as you wish.
For example, if you want the first five lines to be displayed:
head -n 5 filename.ext</description></item><item><title>grep Command in CLI</title><link>https://baransel.dev/post/cli-grep-command/</link><pubDate>Fri, 29 Apr 2022 02:13:50 +0000</pubDate><guid>https://baransel.dev/post/cli-grep-command/</guid><description>grep, the global regular expression print, allows us to select and/or mark from a text stack in the context of the specified pattern. The entered template is processed within the specified path, results suitable for the template are listed by marking. By using it alone or with pipes |, its capabilities can be developed and/or evaluated in different-purpose operations.
The simplest use by itself is as follows.
grep '[search-text/pattern]' [path-to-directory-or-file] We can move on to examples.</description></item><item><title>📰 Weekly Newsletter #1 - 29 Apr 2022</title><link>https://baransel.dev/newsletters/29-04-2022/</link><pubDate>Fri, 29 Apr 2022 00:00:00 +0000</pubDate><guid>https://baransel.dev/newsletters/29-04-2022/</guid><description>Read this on baransel.dev
I’ve recently planned on moving to weekly newsletters rather than daily emails. I am pretty sure this will be a better way to communicate and share more information. Let me know what you think!
Around the Web 📓 Recent blog posts Find files and directories in CLI Create an empty file in CLI Delete a directory in CLI Move and Rename files and directories in CLI 📝 Articles Elon Musk&amp;rsquo;s Rival Hastily Deletes Twitter Account: &amp;lsquo;I Do Not Want My Free Speech to Be Actively Managed’ These 4 Concepts Will Help You Understand Blockchains Be obsessed with feedback, not metrics 💻 Projects HyperUI Coolify Min ✍️ Quote of the week “Wisdom is always an overmatch for strength.</description></item><item><title>Find files and directories in CLI</title><link>https://baransel.dev/post/cli-find-files-directories/</link><pubDate>Thu, 28 Apr 2022 02:13:50 +0000</pubDate><guid>https://baransel.dev/post/cli-find-files-directories/</guid><description>Although the popular use of the find command is to search within the folder path with its option, it can also meet much more specific needs when customized.
The basic usage is as follows:
find [search-to-directory] [option] [search-org] Let&amp;rsquo;s start with examples. Our first example is to find the error.log files on the server.
find / -name &amp;quot;error.log&amp;quot; Or using type;
find / -type f -name &amp;quot;error.log&amp;quot; When this command is applied, the error.</description></item><item><title>Create an empty file in CLI</title><link>https://baransel.dev/post/cli-create-empty-file/</link><pubDate>Wed, 27 Apr 2022 02:13:50 +0000</pubDate><guid>https://baransel.dev/post/cli-create-empty-file/</guid><description>The touch command lets you create new empty files via the command line.
For example, to create an HTML file named index under the Documents directory:
touch /home/username/Documents/index.html</description></item><item><title>Delete a directory in CLI</title><link>https://baransel.dev/post/cli-delete-directory/</link><pubDate>Wed, 27 Apr 2022 02:13:50 +0000</pubDate><guid>https://baransel.dev/post/cli-delete-directory/</guid><description>If you need to delete a directory, use the rmdir command. However, rmdir only lets you delete empty directories.
Example:
rmdir Pictures If you need to delete directories that are not empty, use the rm command.
rm -rf Pictures</description></item><item><title>Move and Rename files and directories in CLI</title><link>https://baransel.dev/post/cli-move-rename-files-directories/</link><pubDate>Mon, 25 Apr 2022 02:13:50 +0000</pubDate><guid>https://baransel.dev/post/cli-move-rename-files-directories/</guid><description>The main use of this command is to move, but it can also be used to rename files.
The usage of this command is also very similar to the cp command. You must enter mv first, then the name of the file and the target directory.
For example:
mv file.txt /home/username/Documents Syntax for renaming files is mv oldname.ext newname.ext</description></item><item><title>Copy files and directories in CLI</title><link>https://baransel.dev/post/cli-copy-files-directories/</link><pubDate>Fri, 22 Apr 2022 02:13:50 +0000</pubDate><guid>https://baransel.dev/post/cli-copy-files-directories/</guid><description>Use the cp command to copy files from the current directory.
For example:
cp example.jpg /home/username/Pictures creates a copy of the example.jpg in the Pictures directory.
to copy a directory, use the -r flag:
cp -r /home/username/Pictures /home/username2/</description></item><item><title>cat Command in CLI</title><link>https://baransel.dev/post/cli-cat-command/</link><pubDate>Wed, 20 Apr 2022 02:13:50 +0000</pubDate><guid>https://baransel.dev/post/cli-cat-command/</guid><description>cat is one of the frequently used commands in Linux. It is used to see the contents of a file on standard output (sdout). To run this command, enter cat followed by the filename and extension. For example: cat file.txt
Here are other ways to use the cat command:
cat &amp;gt; filename creates a new file cat file1 file2 &amp;gt; file3 merge two files (1 and 2) and store the result in a new file (3) cat filename | tr a-z A-Z &amp;gt; result.</description></item><item><title>SQL LIKE and IN Operator</title><link>https://baransel.dev/post/sql-like-and-in-operator/</link><pubDate>Wed, 13 Apr 2022 02:13:50 +0000</pubDate><guid>https://baransel.dev/post/sql-like-and-in-operator/</guid><description>It is used to retrieve data that contains a character or subset of characters in a character set, or to check data that satisfies conditions in a set of data. Don&amp;rsquo;t get confused, you will understand very well with examples.
LIKE Operator For example, let&amp;rsquo;s take the authors with the b character in the name;
SELECT * FROM company WHERE name LIKE &amp;#39;%B%&amp;#39; The point we need to pay attention to here is that it doesn&amp;rsquo;t matter if it is lowercase or uppercase.</description></item><item><title>SQL ORDER BY Operator (ASC, DESC)</title><link>https://baransel.dev/post/sql-order-by-operator/</link><pubDate>Tue, 12 Apr 2022 02:13:50 +0000</pubDate><guid>https://baransel.dev/post/sql-order-by-operator/</guid><description>The ORDER BY command, which is a SQL command, is the command used to obtain ordered tables. Let&amp;rsquo;s take a look at the table we created in our previous posts.
Since the table here is small, we don&amp;rsquo;t have much trouble when we search for a data in the table, but when the number of people here increases, it will be very difficult to find these people in the list. For this, let&amp;rsquo;s sort the list in a certain order.</description></item><item><title>SQL SELECT DISTINCT Statement</title><link>https://baransel.dev/post/sql-distinct-statement/</link><pubDate>Thu, 31 Mar 2022 02:13:50 +0000</pubDate><guid>https://baransel.dev/post/sql-distinct-statement/</guid><description>The DISTINCT statement allows the repetitive data in certain columns of the table to be retrieved as one.
&amp;ldquo;But what good does that do to us?&amp;rdquo; The question may come to our mind, for example, we may have more than one department in our company and more than one staff in each department.
Now, if you wish, let&amp;rsquo;s continue with a small example:
Example query:
SELECT DISTINCT position FROM company where department_no = 12 Output:</description></item><item><title>SQL AND, OR, and NOT Operators</title><link>https://baransel.dev/post/sql-and-or-not-operators/</link><pubDate>Wed, 30 Mar 2022 02:13:50 +0000</pubDate><guid>https://baransel.dev/post/sql-and-or-not-operators/</guid><description>AND, OR, and NOT Operators are logical SQL query commands used for multiple conditional situations on a table. Let&amp;rsquo;s take a look at the table named students that we created earlier.
For example, the class number 149 has more than one student, let&amp;rsquo;s see right away;
SELECT * FROM students WHERE class_no = 149 As you can see, two students are in the same class.
AND Operator Here, we want to draw the line with both the student whose class number is 149 and the information that his final mark is more than 90.</description></item><item><title>SQL Using AS Operator</title><link>https://baransel.dev/post/sql-using-as-operator/</link><pubDate>Mon, 28 Mar 2022 02:13:50 +0000</pubDate><guid>https://baransel.dev/post/sql-using-as-operator/</guid><description>SQL AS Operator (Aliasing) It is the SQL operator that we use to facilitate the use of long and difficult to use column names while making SQL queries and to make our work practical. With this operator we also get more readable tables. The point to note here is that we do not change the column names, we only use these aliases when displaying them to the user. So we do not make any changes to the tables.</description></item><item><title>SQL Select Query</title><link>https://baransel.dev/post/sql-select-query/</link><pubDate>Tue, 22 Mar 2022 02:13:50 +0000</pubDate><guid>https://baransel.dev/post/sql-select-query/</guid><description>SELECT Query SELECT * FROM students This command is used to query all the data in the Students table, by typing all the columns in that table instead of *, we get them all.
SELECT id ,name ,surname ,quiz ,midterm ,final ,class_no FROM students We need to specify the column names with commas after the SELECT statement.
FROM indicates where, * indicates all data, SELECT indicates what to do with the obtained data.</description></item><item><title>SQL UPDATE and DELETE Commands</title><link>https://baransel.dev/post/sql-update-and-delete-commands/</link><pubDate>Mon, 21 Mar 2022 02:13:50 +0000</pubDate><guid>https://baransel.dev/post/sql-update-and-delete-commands/</guid><description>UPDATE Statment UPDATE statement is a SQL DML statement used to change and update the data in tables. We will explain the UPDATE statement with sample applications. Let&amp;rsquo;s take a look at how this expression is used.
UPDATE table_name SET = column1 = new_value, column2 = new_value WHERE condition Now let&amp;rsquo;s write our codes, for this, let&amp;rsquo;s see our table first.
For example, let&amp;rsquo;s add 10 points to the second exam grade of the student whose name is Baransel;</description></item><item><title>SQL INSERT Command</title><link>https://baransel.dev/post/sql-insert-command/</link><pubDate>Tue, 15 Mar 2022 02:13:50 +0000</pubDate><guid>https://baransel.dev/post/sql-insert-command/</guid><description>What is SQL INSERT Command? The SQL Insert command is a SQL DML (Data Manipulation Language) command used to insert data into any table in the database. If you wish, you can add data to the tables in a very simple way via phpMyAdmin. But you cannot always use this method, for example in a web project you cannot manually add the information in the user registration form to the database.</description></item><item><title>SQL DDL Commands</title><link>https://baransel.dev/post/sql-ddl-commands/</link><pubDate>Thu, 10 Mar 2022 02:13:50 +0000</pubDate><guid>https://baransel.dev/post/sql-ddl-commands/</guid><description>What is SQL DDL(Data Definition Language)? DDL deals with the type of data in the database. In other words, we do all of these with DDL, what will be the relations between the tables in the database and the types of data in the table. DDL basically consists of three commands.
CREATE: Used to create objects (Table/Database etc.)
ALTER: It is used to modify objects.
DROP: Used to delete objects</description></item><item><title>Introduction to SQL</title><link>https://baransel.dev/post/sql-introduction/</link><pubDate>Wed, 09 Mar 2022 02:13:50 +0000</pubDate><guid>https://baransel.dev/post/sql-introduction/</guid><description>What is SQL? SQL (Structered Query Language), SQL is definitely not a programming language. As a sub-language, it is used for database operations, and the general syntax is almost the same for all databases.
Where Is SQL Used, What Does It Do? The main use of SQL is in databases, and it is needed to process the data stored in the database. It enables the data to be modeled within the targeted task definition.</description></item><item><title>Python Modules</title><link>https://baransel.dev/post/python-modules/</link><pubDate>Mon, 07 Mar 2022 02:13:50 +0000</pubDate><guid>https://baransel.dev/post/python-modules/</guid><description>What is a Module? We have always avoided code duplication throughout the Python tutorials series. We used functions and classes for this. So can we use these functions or classes in another project? In this blog post, we will cover this subject a little more deeply. Let me define the modules immediately; Modules are Python files that contain functions, classes, and properties. You can call and use these files in any project you want.</description></item><item><title>Just Five News · Daily News</title><link>https://baransel.dev/post/just-five-news-daily-news/</link><pubDate>Sat, 05 Mar 2022 02:13:50 +0000</pubDate><guid>https://baransel.dev/post/just-five-news-daily-news/</guid><description>Just Five News · Daily News
Just 5 Top headlines of the world you need to start your day with.
A PWA Site having news headlines, Twitter trends, quotes, facts. using RSS feeds, APIs</description></item><item><title>Python Multiple Inheritance</title><link>https://baransel.dev/post/python-multiple-inheritance/</link><pubDate>Mon, 21 Feb 2022 02:13:50 +0000</pubDate><guid>https://baransel.dev/post/python-multiple-inheritance/</guid><description>Python Multiple Inheritance In our previous post, while we were talking about inheritance, a class was inheriting the properties and functions of another class. So what is multiple inheritance? Multiple inheritance is when a class inherits the properties and functions of more than one class.
Just like a child in real life has the characteristics of both his/her parents. Let&amp;rsquo;s start coding right away, you will understand much better.
class Mother: def print_Mother(self): print(&amp;#34;Features of the mother class&amp;#34;) class Father: def print_Father(self): print(&amp;#34;Features of the father class&amp;#34;) class Child(Mother, Father): pass object_d = Child() object_d.</description></item><item><title>Python Inheritance</title><link>https://baransel.dev/post/python-inheritance/</link><pubDate>Sun, 20 Feb 2022 02:13:50 +0000</pubDate><guid>https://baransel.dev/post/python-inheritance/</guid><description>What is Python Inheritance? When you work in large projects, you will see that the project consists of submodules, subparticles, and many features of these submodules are already in the main module. For this, you will have to create the features and functions for the submodules each time, which will literally turn into a torture for you. This is where the concept of inheritance emerges.
Inheritance, is a concept that comes with object-oriented programming (OOP).</description></item><item><title>Python Encapsulation</title><link>https://baransel.dev/post/python-encapsulation/</link><pubDate>Fri, 18 Feb 2022 02:13:50 +0000</pubDate><guid>https://baransel.dev/post/python-encapsulation/</guid><description>What is Python Encapsulation? Encapsulation means restricting the access of methods and variables. We add the direct access and change restriction feature to methods or variables. So why are we doing this? Because the codes we write should not be changed or the values we change should be changed in a controlled manner. It is in these situations that encapsulation comes to our rescue like a magic wand. Now let&amp;rsquo;s show with examples.</description></item><item><title>Python Object-oriented Programming (OOP)</title><link>https://baransel.dev/post/python-object-oriented-programming-oop/</link><pubDate>Thu, 17 Feb 2022 02:13:50 +0000</pubDate><guid>https://baransel.dev/post/python-object-oriented-programming-oop/</guid><description>Why Object-oriented Programming (OOP) I&amp;rsquo;m sure you have in mind why object-oriented programming? Do I have to know object-oriented programming? There are such questions. Then let&amp;rsquo;s answer.
You don&amp;rsquo;t have to know object-oriented programming. Especially in Python, you can do very good things without knowing object-oriented programming. Python does not force you to use object-oriented programming.
Well then you will say, why am I learning object-oriented programming? Now that I have told you why you should use object-oriented programming, then you will see that knowing object-oriented programming is a necessity.</description></item><item><title>Python Functions args and kwargs Structure</title><link>https://baransel.dev/post/python-args-kwargs-functions-structure/</link><pubDate>Tue, 15 Feb 2022 02:13:50 +0000</pubDate><guid>https://baransel.dev/post/python-args-kwargs-functions-structure/</guid><description>What are *args and **kwargs? These structures are sometimes used when we do not know the number of parameters to import or the number of parameters varies. Thus, we bring dynamism to our function. Let&amp;rsquo;s show it with an example; For example, let&amp;rsquo;s write a function that sums the entered numbers.
def add(number1, number2): print(sum([number1, number2])) add(6, 9) It works very well, so let&amp;rsquo;s add another number, this time add three numbers.</description></item><item><title>Python Embedded Functions</title><link>https://baransel.dev/post/python-embedded-functions/</link><pubDate>Sat, 12 Feb 2022 02:13:50 +0000</pubDate><guid>https://baransel.dev/post/python-embedded-functions/</guid><description>What is an embedded function? Embedded functions are functions that come ready with the Python installation, unlike the functions we have created. Since these functions were previously developed by Python developers, we do not need to define these functions. E.g; These functions that we have used before, such as print(), len(), type(), input(), are embedded functions. We can directly call and use these functions without defining them. In this blog post, we will cover some important embedded functions that will be useful to us.</description></item><item><title>Python Lambda Function</title><link>https://baransel.dev/post/python-lambda-function/</link><pubDate>Fri, 11 Feb 2022 02:13:50 +0000</pubDate><guid>https://baransel.dev/post/python-lambda-function/</guid><description>Why Lambda Function? In our previous blog posts, we discussed Functions, if we describe functions with a sentence, we used functions to avoid code repetition, to write more organized code and most importantly to get rid of code complexity. If you haven&amp;rsquo;t looked at the Functions lesson, you should click on the link and look at that lesson first in order to better understand this lesson.
Lambda function is an advanced function, like recursive functions.</description></item><item><title>Python Global and Local Variables</title><link>https://baransel.dev/post/python-global-local-variables/</link><pubDate>Thu, 10 Feb 2022 02:13:50 +0000</pubDate><guid>https://baransel.dev/post/python-global-local-variables/</guid><description>In this blog post, we will learn the scope of Functions, namely Global and Local variables, scopes and namespace expressions. Let&amp;rsquo;s start.
As in all programming languages, every class, function and variable has a scope. To put it simply, a block and namespace in which the variables we create are valid are stored in that namespace and are deleted from memory when you leave that block.
Local Variable Let&amp;rsquo;s show it with a simple example;</description></item><item><title>Python Functions</title><link>https://baransel.dev/post/python-functions/</link><pubDate>Wed, 09 Feb 2022 02:13:50 +0000</pubDate><guid>https://baransel.dev/post/python-functions/</guid><description>What is Function? Functions are simply a set of commands created to do a particular function. For example, the print() function contains certain commands to make the function that allows us to output to the screen.
Why Functions? Now you have thought of something like this, is it okay if I don&amp;rsquo;t use a function? Of course, you can not use it, but after a certain point, when the line of code increases, the complexity increases, and it becomes difficult to control.</description></item><item><title>Python File Operations</title><link>https://baransel.dev/post/python-file-operations/</link><pubDate>Tue, 08 Feb 2022 02:13:50 +0000</pubDate><guid>https://baransel.dev/post/python-file-operations/</guid><description>First, we have a problem that we constantly experience while doing file operations. When we try to read the file or save the file, we get errors such as where we saved the file and when trying to open the file, the file could not be reached, the file does not exist. For this reason, we first do the operations related to the file, etc. Let&amp;rsquo;s find out the directory we made.</description></item><item><title>What is Captcha &amp; How to Bypass Captcha</title><link>https://baransel.dev/post/what-is-captcha-and-how-to-bypass-it/</link><pubDate>Mon, 07 Feb 2022 02:13:50 +0000</pubDate><guid>https://baransel.dev/post/what-is-captcha-and-how-to-bypass-it/</guid><description>Disclaimer: This information is for educational purposes only.
What does Captcha mean? Captcha is a security measure used to distinguish between computer and human behavior.
It is also used to prevent password guessing attacks (Brute Force) performed by trial and error method by increasing security on account access points.
Is Captcha sufficient? A study showed us that CAPTCHA is insufficient. There are many ways to circumvent Captcha, but for now, the most effective of them is CAPTCHA Solving Services.</description></item><item><title>Python Set and Frozenset</title><link>https://baransel.dev/post/python-set-and-frozenset/</link><pubDate>Tue, 01 Feb 2022 02:13:50 +0000</pubDate><guid>https://baransel.dev/post/python-set-and-frozenset/</guid><description>What is Set and frozenset? In our previous Data Types blog post, we divided the data types in Python into mutable (Mutable) and immutable (unchangeable) and here we will process both mutable and immutable data types.
Dictionaries are a little different because Dictionaries consist of two parts; keys and values, value part can contain all data type but keys part can only be of string and int type.
What is Set?</description></item><item><title>Python dictionary and dictionary methods</title><link>https://baransel.dev/post/python-dictionary-and-dictionary-methods/</link><pubDate>Fri, 19 Nov 2021 02:13:50 +0000</pubDate><guid>https://baransel.dev/post/python-dictionary-and-dictionary-methods/</guid><description>What is Dictionary? We have said that there are mutable (modifiable) data types that contain different data types such as Tuple and List data types in dictionaries and are shown with curly braces.
Dictionaries are a little different because Dictionaries consist of two parts; keys and values, value part can contain all data type but keys part can only be of string and int type.
How to Use Dictionaries? Before I show its usage, Lets explain why dictionary; Imagine that you are making an English dictionary, how would it be without a database.</description></item><item><title>Python tuple and tuple methods</title><link>https://baransel.dev/post/python-tuple-and-tuple-methods/</link><pubDate>Sun, 14 Nov 2021 02:13:50 +0000</pubDate><guid>https://baransel.dev/post/python-tuple-and-tuple-methods/</guid><description>What is Tuple? If we explain what tuples are; Tuples are immutable dats types that can contain more than one data type, denoted by commas or parentheses.
How to Use Tuples? Let&amp;rsquo;s show it with an example;
tuple = (&amp;#34;Python&amp;#34;, &amp;#34;PHP&amp;#34;, &amp;#34;Flutter&amp;#34;, &amp;#34;Go&amp;#34;) print(tuple) (&amp;#39;Python&amp;#39;, &amp;#39;PHP&amp;#39;, &amp;#39;Flutter&amp;#39;, &amp;#39;Go&amp;#39;) Or we can show it with commas;
tuple = &amp;#34;Python&amp;#34;, &amp;#34;PHP&amp;#34;, &amp;#34;Flutter&amp;#34;, &amp;#34;Go&amp;#34; print(tuple) (&amp;#39;Python&amp;#39;, &amp;#39;PHP&amp;#39;, &amp;#39;Flutter&amp;#39;, &amp;#39;Go&amp;#39;) But there is a very important point that we need to pay attention to here, if we are going to use a comma and if the tuple has one element, when we do not put a comma at the end, the interpreter perceives it as a String (character array).</description></item><item><title>Python list and list methods</title><link>https://baransel.dev/post/python-list-and-list-methods/</link><pubDate>Sat, 13 Nov 2021 02:13:50 +0000</pubDate><guid>https://baransel.dev/post/python-list-and-list-methods/</guid><description>Lists Briefly, we said that Lists can contain more than one data type, are shown with square brackets and are mutable. Now let&amp;rsquo;s show Lists with an example.
list =[9, &amp;#34;Python&amp;#34;, 7.2, [8, 1], (&amp;#34;PHP&amp;#34;, 5, &amp;#39;b&amp;#39;)] As you can see above, we created a List named list.
Well, if you ask how we can reach the elements of the list, let&amp;rsquo;s show it right away.
Accessing Lists Elements list[2] 7.</description></item><item><title>Python loops</title><link>https://baransel.dev/post/python-loops/</link><pubDate>Fri, 12 Nov 2021 02:13:50 +0000</pubDate><guid>https://baransel.dev/post/python-loops/</guid><description>If we want to print &amp;ldquo;Python Lessons&amp;rdquo; on the screen ten times, we need to use the print() function ten times.
That&amp;rsquo;s what we&amp;rsquo;re going to do with Python loops. There are two different types of loops; while and for, I will also touch on the range() and len() functions and break, continue and in statements that we need in these loops.
while loop It is a type of loop that allows us to rerun the code we wrote in Python.</description></item><item><title>Python get input from user</title><link>https://baransel.dev/post/python-get-input-from-user/</link><pubDate>Thu, 11 Nov 2021 02:13:50 +0000</pubDate><guid>https://baransel.dev/post/python-get-input-from-user/</guid><description>input() Let&amp;rsquo;s show the use of the input() function simply by taking the name from the user.
name = input(&amp;#34;Enter your name: &amp;#34;) print(name) Output:
Enter your name: Baransel Baransel As seen above, we received a name information from the user. We printed the information we received with the print() function, which we processed in our previous blog post.
For example, let&amp;rsquo;s take two numbers from the user and add them</description></item><item><title>Python comment line</title><link>https://baransel.dev/post/python-comment-line/</link><pubDate>Wed, 10 Nov 2021 02:13:50 +0000</pubDate><guid>https://baransel.dev/post/python-comment-line/</guid><description>What is the Comment Line and why use it? Readability, which is an important issue in the software world, is also a very important comment line and explanation lines. It is a magic wand that allows someone else to understand the code we write or for us to understand someone else&amp;rsquo;s code. Especially when you work in a company or when you are in a big project, you will deal with thousands of lines of code.</description></item><item><title>Python print function</title><link>https://baransel.dev/post/python-print-function/</link><pubDate>Tue, 09 Nov 2021 02:13:50 +0000</pubDate><guid>https://baransel.dev/post/python-print-function/</guid><description>What is the print() Function? To explain briefly without confusing you too much, the print() function is a function that allows us to output to the screen.
How to Use the print() Function? The print() function has three different uses;
Single quotes (' ') Double quotes (&amp;quot; &amp;quot;) Three quotes (“”” “””) Let&amp;rsquo;s look at an example;
print(&amp;#39;baransel.dev Python Lessons&amp;#39;) print(&amp;#34;baransel.dev Python Lessons&amp;#34;) print(&amp;#34;&amp;#34;&amp;#34;baransel.dev Python Lessons&amp;#34;&amp;#34;&amp;#34;) Output:
baransel.dev Python Lessons baransel.</description></item><item><title>A Git Cheat Sheet</title><link>https://baransel.dev/post/git-cheat-sheet/</link><pubDate>Mon, 08 Nov 2021 02:13:50 +0000</pubDate><guid>https://baransel.dev/post/git-cheat-sheet/</guid><description>Intro When it comes to version control systems, there are few software that can beat GIT in performance and relevance. GIT was developed by Linus Torvalds in 2005 and today, millions of companies use it for efficient code management and version control of their projects. Open source software is available for download for Linux, Windows, Solaris and Mac platforms.
GIT Commands git config One of the most used git commands, email, username and file format etc.</description></item><item><title>Flutter ListView and Features</title><link>https://baransel.dev/post/flutter-listview-features/</link><pubDate>Thu, 21 Oct 2021 02:13:50 +0000</pubDate><guid>https://baransel.dev/post/flutter-listview-features/</guid><description>We will cover Flutter ListView and Features, Listview comparison on Android. When creating ListView in Android, especially when creating lists with images, we needed extra model class, but when creating ListView in Flutter we don&amp;rsquo;t need any model class. For this, it is quite simple to create a listview in flutter.
First, let&amp;rsquo;s examine a simple ListView structure consisting of only texts and make an example.
So what is the structure we call ListView?</description></item><item><title>Flutter Button Types and Features</title><link>https://baransel.dev/post/flutter-button-types-features/</link><pubDate>Wed, 13 Oct 2021 02:13:50 +0000</pubDate><guid>https://baransel.dev/post/flutter-button-types-features/</guid><description>We will talk about the most used Flutter button types and their features. When developing an application with Flutter, we can start with the example that comes up when we first open it. With the button placed in the lower right corner of the screen, we +1 to the number in the center of the screen as it is clicked. Actually, the button type used in this example is called Floating Action Button.</description></item><item><title>Flutter General Page Structures</title><link>https://baransel.dev/post/flutter-general-page-structures/</link><pubDate>Mon, 11 Oct 2021 02:13:50 +0000</pubDate><guid>https://baransel.dev/post/flutter-general-page-structures/</guid><description>We will talk about the widgets we use while designing our screen in Flutter in general, and their features and usage areas. In other words, we can say that they are structures where we adjust how we place our elements, such as a little alignment and button/image. It may also be the bone structure. We will cover page design, widget design and features.
Center First, we can start with the Center widget.</description></item><item><title>Flutter Widgets Stateless – Stateful Widget Difference</title><link>https://baransel.dev/post/flutter-widgets-stateless-and-stateful/</link><pubDate>Sat, 02 Oct 2021 02:13:50 +0000</pubDate><guid>https://baransel.dev/post/flutter-widgets-stateless-and-stateful/</guid><description>We will discuss the concept of widget, which is one of the structures we hear the most in Flutter. At the same time, we will talk about Stateless and Stateful widgets that change shape according to our page structure.
What is widget? Almost everything in Flutter is widget, and the concept we call widgets are components that are given to us ready-made. Many structures, like each interface element, are considered as widgets.</description></item><item><title>Introduction to Flutter</title><link>https://baransel.dev/post/what-is-flutter/</link><pubDate>Fri, 01 Oct 2021 02:13:50 +0000</pubDate><guid>https://baransel.dev/post/what-is-flutter/</guid><description>What is Flutter? Flutter is a framework developed by Google. It is used to develop applications on cross-platform. So our application we wrote with Flutter; web and performs on both ios and android devices. In other words, we can have an application that can run on many platforms with a single code. In this way, we can save both cost and time. Google first used Flutter when developing the Fuschia operating system.</description></item><item><title>Lambda Functions in Dart</title><link>https://baransel.dev/post/dart-lambda-functions/</link><pubDate>Thu, 30 Sep 2021 02:13:50 +0000</pubDate><guid>https://baransel.dev/post/dart-lambda-functions/</guid><description>Every function in dart is an object.
Functions that we use very often without a name are also called lambda functions.
You can see usage example and output below.</description></item><item><title>Map Structures (Dictionary) in Dart</title><link>https://baransel.dev/post/dart-map-structure/</link><pubDate>Wed, 29 Sep 2021 02:13:50 +0000</pubDate><guid>https://baransel.dev/post/dart-map-structure/</guid><description>The map structure is one of the list types that allows us to keep more than one data. The most important features of Map:
It works as key – value. unordered We can think of this structure as a dictionary. A word has only one meaning. Here too, word=key, meaning=value corresponding to the word.
It is also important because we use the Map structure a lot when using a database.</description></item><item><title>youtube_video_info - Flutter package</title><link>https://baransel.dev/post/flutter-youtube-video-info-package/</link><pubDate>Wed, 15 Sep 2021 02:13:50 +0000</pubDate><guid>https://baransel.dev/post/flutter-youtube-video-info-package/</guid><description>pub.dev/youtube_video_info github.com/kaex/youtube_video_info This is a lightweight⚡ package to fetch video info for YouTube from the url
To install, add to pubspec.yaml flutter: sdk: flutter youtube_video_info: ^1.0.0 and then run flutter pub get
Import the library
import &amp;#39;package:youtube_video_info/youtube.dart&amp;#39;; Calling the method YoutubeDataModel videoData = await YoutubeData.getData(link); Example var title = videoData.title; // &amp;#34;Ed Sheeran - Bad Habits [Official Video]&amp;#34; var averageRating = videoData.averageRating; // 4.13242 var durationSeconds = videoData.durationSeconds; // 167</description></item><item><title>Set structures in Dart</title><link>https://baransel.dev/post/dart-set-structure/</link><pubDate>Fri, 10 Sep 2021 02:13:50 +0000</pubDate><guid>https://baransel.dev/post/dart-set-structure/</guid><description>Set structure is a type of list that we use to hold multiple data like List. It has the same features as List.
Unlike List;
It is unordered. 2 identical elements cannot be found. (unique) You can see the example below:
Set&amp;lt;String&amp;gt; names = Set(); List&amp;lt;String&amp;gt; words = []; main() { names.add(&amp;#39;Baran&amp;#39;); names.add(&amp;#39;Baran&amp;#39;); names.add(&amp;#39;Baran&amp;#39;); names.add(&amp;#39;Batuhan&amp;#39;); words.add(&amp;#39;Turgut&amp;#39;); words.add(&amp;#39;Turgut&amp;#39;); words.add(&amp;#39;Berk&amp;#39;); words.add(&amp;#39;Ege&amp;#39;); print(&amp;#34;Data defined by Set;&amp;#34;); print(names); print(&amp;#34;Data defined by List;&amp;#34;); print(words); } The output is:</description></item><item><title>Lists in Dart</title><link>https://baransel.dev/post/dart-lists/</link><pubDate>Wed, 08 Sep 2021 02:13:50 +0000</pubDate><guid>https://baransel.dev/post/dart-lists/</guid><description>In the Dart programming language, there is no Array construct. Instead, we use the List structure. This List structure, which we use to hold more than one data, is also divided into two:
Fixed length Growing structure Below you can see the definitions of these two features. List structure can take variable data type according to the values it will take. The data is sequential. We can easily perform functions such as adding and deleting data to the list structure with ready-made methods.</description></item><item><title>Ternary if operator in Dart</title><link>https://baransel.dev/post/dart-ternary-if-operator/</link><pubDate>Mon, 23 Aug 2021 02:13:50 +0000</pubDate><guid>https://baransel.dev/post/dart-ternary-if-operator/</guid><description>What we call Ternary If is a short use of the if control structure. You can see its usage in the example below.
Syntax:
condition ? exprIfTrue : exprIfFalse Normal if else usage:
int height = 185; String heightCategory = &amp;#39;&amp;#39;; main() { if (height &amp;gt; 175) { heightCategory = &amp;#39;Tall&amp;#39;; } else { heightCategory = &amp;#39;Short&amp;#39;; } print(heightCategory); } Using Ternary If operators:
main() { int height = 185; String heightCategory = height &amp;gt; 175 ?</description></item><item><title>Variables and Data Types in Dart</title><link>https://baransel.dev/post/dart-variables-data-types/</link><pubDate>Fri, 20 Aug 2021 02:13:50 +0000</pubDate><guid>https://baransel.dev/post/dart-variables-data-types/</guid><description>In addition to general data types such as String, integer, we use different; We will talk about 2 important data types.
var dynamic The var data type does not have a specific value. We can assign any variable we want, it doesn&amp;rsquo;t matter. You can give a string or an integer value if you wish, to the variable defined by var. You can see examples below.
var name = &amp;#39;Baransel Arslan&amp;#39;; var age = 20; var message = &amp;#39;Welcome!</description></item><item><title>Basic commands in CLI</title><link>https://baransel.dev/post/basic-cli-commands/</link><pubDate>Sat, 07 Aug 2021 02:13:50 +0000</pubDate><guid>https://baransel.dev/post/basic-cli-commands/</guid><description>Here is a summary of some useful commands:
Command (Windows) Command (Mac OS - GNU/Linux) Description exit exit closes the window cd cd change directory cd pwd show current directory dir ls list directory/files copy cp copy file move mv move file mkdir mkdir create a new directory rmdir /S rm -r delete the folder</description></item><item><title>Create directory in CLI</title><link>https://baransel.dev/post/cli-create-directory/</link><pubDate>Fri, 06 Aug 2021 02:13:50 +0000</pubDate><guid>https://baransel.dev/post/cli-create-directory/</guid><description>How about creating a directory on your desktop to do it hands-on? You can do it this way:
$ mkdir pictures This little command will create a folder called pictures on your desktop. You can use the ls or dir commands to check if it&amp;rsquo;s there! Try. :)
Pro tip: If you don&amp;rsquo;t want to type the same commands over and over, you can switch between commands by pressing the up arrow and down arrow keys.</description></item><item><title>Change directory in CLI</title><link>https://baransel.dev/post/cli-change-directory/</link><pubDate>Thu, 05 Aug 2021 02:13:50 +0000</pubDate><guid>https://baransel.dev/post/cli-change-directory/</guid><description>Now, let&amp;rsquo;s go to our Desktop directory:
$ cd Desktop Let&amp;rsquo;s see if it really has changed:
$ pwd /Users/baransel/Desktop Pro Tip: If you type cd D and press tab on your keyboard, the command line completes the rest of the name, and you navigate faster. If there is more than one folder starting with &amp;ldquo;D&amp;rdquo;, press tab twice to see other options.</description></item><item><title>List files and directories in CLI</title><link>https://baransel.dev/post/cli-list-files-and-directories/</link><pubDate>Wed, 04 Aug 2021 02:13:50 +0000</pubDate><guid>https://baransel.dev/post/cli-list-files-and-directories/</guid><description>So what&amp;rsquo;s inside? It would be great to know. Come on, let&amp;rsquo;s:
$ ls Applications Desktop Documents Downloads Music ... Note: &amp;lsquo;ls&amp;rsquo; stands for &amp;ldquo;list files&amp;rdquo;.</description></item><item><title>Get current directory in CLI</title><link>https://baransel.dev/post/cli-get-current-directory/</link><pubDate>Tue, 03 Aug 2021 02:13:50 +0000</pubDate><guid>https://baransel.dev/post/cli-get-current-directory/</guid><description>It would be nice to know where we are, wouldn&amp;rsquo;t it? Let&amp;rsquo;s see. Type this command and press enter:
$ pwd /Users/baransel Note: &amp;lsquo;pwd&amp;rsquo; means &amp;ldquo;print working directory&amp;rdquo;.
When you open the command line you usually start in your user&amp;rsquo;s home directory.</description></item><item><title>Checking if file exists in PHP</title><link>https://baransel.dev/post/php-check-if-file-exists/</link><pubDate>Sat, 26 Jun 2021 02:13:50 +0000</pubDate><guid>https://baransel.dev/post/php-check-if-file-exists/</guid><description>We will use the file_exists() function to be aware of the existence of the files, to change them if they are, or to create them.
If there is a file with the name of the file that we will enter the parameter, it will return TRUE, otherwise it will return FALSE. Let&amp;rsquo;s show it with an example:
&amp;lt;?php if(file_exists(&amp;#39;hello.txt&amp;#39;)) { echo &amp;#39;File exists&amp;#39;; } else { echo &amp;#39;File not existing&amp;#39;; }</description></item><item><title>Deleting a file in PHP</title><link>https://baransel.dev/post/php-delete-a-file/</link><pubDate>Fri, 25 Jun 2021 02:13:50 +0000</pubDate><guid>https://baransel.dev/post/php-delete-a-file/</guid><description>You can destroy the file you want with the unlink() function, which we will see as the opposite of the file creation function.
Its use is as simple as the build function and has one parameter.
unlink(&amp;#39;hello.txt&amp;#39;); It deletes the hello.txt file that we are working on.</description></item><item><title>Writing to file with PHP</title><link>https://baransel.dev/post/php-writing-to-file/</link><pubDate>Thu, 24 Jun 2021 02:13:50 +0000</pubDate><guid>https://baransel.dev/post/php-writing-to-file/</guid><description>We will use the w mode and the fwrite() function to write files. The content of the file that we access only when using the w mode is completely deleted and replaced with the value we will write.
If you want to write without losing pre-existing content then you will need to use the a mode.
This function works with two parameters. In the first parameter we write the variable that we access the file with fopen(), and in the second parameter we write the content to be written.</description></item><item><title>Reading the contents of files with PHP</title><link>https://baransel.dev/post/php-reading-the-contents-of-files/</link><pubDate>Wed, 23 Jun 2021 02:13:50 +0000</pubDate><guid>https://baransel.dev/post/php-reading-the-contents-of-files/</guid><description>To perform this operation, we will use the r mode in fopen() and the fread() function to access the content.
In the first parameter of this function, we will write the variable of the file we opened with fopen. In the second parameter, we will specify how many bytes we will read from the file.
&amp;lt;?php $file = fopen(&amp;#39;hello.txt&amp;#39;, &amp;#39;r&amp;#39;); $content = fread($file, filesize(&amp;#39;hello.txt&amp;#39;)); echo $content; fclose($file); Now, if there is something in our hello.</description></item><item><title>PHP fopen() function</title><link>https://baransel.dev/post/php-fopen-function/</link><pubDate>Tue, 22 Jun 2021 02:13:50 +0000</pubDate><guid>https://baransel.dev/post/php-fopen-function/</guid><description>Before we can read, modify or delete the contents of the files, we need to open them in PHP. This opening process should not be understood in the sense of reading. Before starting the necessary operations, it means to open the file in the sense of providing the first access and connection.
We will do this access with the fopen() function. This function works with two parameters. In the first parameter, we enter the file path that we will access, and in the second parameter, we enter the mode that will indicate what we are accessing the file for.</description></item><item><title>Replace content with Regex</title><link>https://baransel.dev/post/php-replace-content-with-regex/</link><pubDate>Tue, 15 Jun 2021 02:13:50 +0000</pubDate><guid>https://baransel.dev/post/php-replace-content-with-regex/</guid><description>Let&amp;rsquo;s explain with a useful example. Let&amp;rsquo;s link the URLs written plainly in the entered text in HTML format. For this, you first need a pattern that will express a URL. I chose one of the ready-made samples on the internet. In expressions that match the preg_replace function, we can change the expressions we grouped in parentheses as we want.
&amp;lt;?php // Pattern capturing URLs $pattern = &amp;#39;(https?://(([a-zA-Z0-9]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?.)+[a-zA-Z]{2,6}/?[^bs]+))&amp;#39;; $content = &amp;#39;Baransel.</description></item><item><title>Regular Expression get captured content</title><link>https://baransel.dev/post/php-regular-expression-get-captured-content/</link><pubDate>Mon, 10 May 2021 02:13:50 +0000</pubDate><guid>https://baransel.dev/post/php-regular-expression-get-captured-content/</guid><description>We write the expressions of the contents that we want to capture and separate in regular expressions in parentheses. We will access the contents that match the expressions written in parentheses, thanks to the preg_match_all function. This function includes the setting g which allows it to scan all content, so when using preg_match_all you don&amp;rsquo;t need to type in the setting g (global).
Apart from theoretical information and examples, I think we can grasp it better by looking at their use in real life.</description></item><item><title>Checking if the regular expression matches</title><link>https://baransel.dev/post/php-checking-if-regular-expression-matches/</link><pubDate>Sun, 09 May 2021 02:13:50 +0000</pubDate><guid>https://baransel.dev/post/php-checking-if-regular-expression-matches/</guid><description>Let&amp;rsquo;s come to using these useful operations on PHP. We will introduce a few useful functions for this.
With the preg_match function, we can check that the expression we wrote does not match the content we provide. In the example we will check if the input has a valid time format.
&amp;lt;?php $pattern= &amp;#39;/^([01][0-9]|[2][0-3]):[0-5][0-9]:[0-5][0-9]$/&amp;#39;; $content = &amp;#39;23:15:59&amp;#39;; if(preg_match($pattern, $content)) { echo &amp;#39;A correct time has been entered.&amp;#39;; } else { echo &amp;#39;An incorrect time format has been entered.</description></item><item><title>Catch by beginning and end in Regular Expression</title><link>https://baransel.dev/post/php-regular-expression-catch-by-beginning-and-end/</link><pubDate>Sat, 08 May 2021 02:13:50 +0000</pubDate><guid>https://baransel.dev/post/php-regular-expression-catch-by-beginning-and-end/</guid><description>With the ^ and $ characters, we can express what the beginning, or the end will look like. As an example, let&amp;rsquo;s try sorting out content that starts with just hello.
/^hello/ This sample text won&amp;rsquo;t match anything because it doesn&amp;rsquo;t start with hello.
hello! this example will match.
Another example that will capture the text between that begins with hello and ends with goodbye;
/^hello(.+)goodbye$/ hello these places will be caught goodbye</description></item><item><title>Catch words in Regular Expression</title><link>https://baransel.dev/post/php-regular-expression-catch-words/</link><pubDate>Fri, 07 May 2021 02:13:50 +0000</pubDate><guid>https://baransel.dev/post/php-regular-expression-catch-words/</guid><description>We can do it with a similar expression with the example on this post.
/(w+)/g We have said that w expression means any letter, but you should know that Turkish characters are exceptions to this expression. If we are working with a Turkish content, the statement we need to make should be as follows;
/([a-zA-ZÇŞĞÜÖİçşğüöı]+)/g With this expression, we can also catch Turkish words.
As another example, let&amp;rsquo;s try to take just a desired word from the content.</description></item><item><title>Catch numbers in Regular Expression</title><link>https://baransel.dev/post/php-regular-expression-catch-numbers/</link><pubDate>Sat, 20 Mar 2021 02:13:50 +0000</pubDate><guid>https://baransel.dev/post/php-regular-expression-catch-numbers/</guid><description>Let&amp;rsquo;s now come to the example usage of the characters we listed in the table on this post. We will use the &amp;ldquo;d&amp;rdquo; and &amp;ldquo;+&amp;rdquo; characters to find only numbers in the content entered.
/d+/g This example only matches the numbers 1234, 321 789. With the setting &amp;ldquo;g&amp;rdquo;, we expressed the comprehensive search, not just once.
At the beginning of the &amp;ldquo;+&amp;rdquo; character, which denotes one or more repetitions, we wrote &amp;ldquo;d&amp;rdquo;, which denotes any number.</description></item><item><title>Flags in Regular Expression</title><link>https://baransel.dev/post/php-regular-expression-flags/</link><pubDate>Fri, 19 Mar 2021 02:13:50 +0000</pubDate><guid>https://baransel.dev/post/php-regular-expression-flags/</guid><description>Regex patterns are written between the two &amp;ldquo;/&amp;rdquo; (slash) signs. Optionally, regex setting characters are entered after the trailing slash.
Flags:
Character Description i Case insensitive g Doesn&amp;rsquo;t stop at the first match, does extensive scanning s Allows the dot character, which refers to anything except the carriage return, to refer to the carriage return as well. m Makes the ^ and $ characters represent the beginning and end of each line Example usage:</description></item><item><title>Special characters in Regular Expression</title><link>https://baransel.dev/post/php-regular-expression-special-characters/</link><pubDate>Wed, 10 Feb 2021 02:13:50 +0000</pubDate><guid>https://baransel.dev/post/php-regular-expression-special-characters/</guid><description>Regular expressions have special characters with lots of meaning and expressions. We express what we want to do with these and reach the desired result. Let&amp;rsquo;s first look at what these characters are, and then try how they are used with examples.
Special characters used in regular expressions:
Character Explanation d Refers to any number . Refers to any character except carriage return w Refers to any letter, number, or underscore s Refers to any invisible character and void.</description></item><item><title>Updating or Deleting rows in PDO PHP</title><link>https://baransel.dev/post/php-pdo-updating-or-deleting-rows/</link><pubDate>Tue, 09 Feb 2021 02:13:50 +0000</pubDate><guid>https://baransel.dev/post/php-pdo-updating-or-deleting-rows/</guid><description>We can run our edit and delete queries with the exec method, which works in the same way as the insert method above. The only difference is this time we get the number of rows affected.
&amp;lt;?php //update $affected = DB::exec(&amp;#39;UPDATE users SET scores = 10 WHERE id &amp;gt; 30&amp;#39;); echo $affected . &amp;#39; users updated.&amp;#39;; //delete $affected = DB::exec(&amp;#39;DELETE FROM users WHERE id &amp;lt; 30&amp;#39;); echo $affected . &amp;#39; users deleted.</description></item><item><title>Insert new row in PDO PHP</title><link>https://baransel.dev/post/php-pdo-insert-new-row/</link><pubDate>Mon, 08 Feb 2021 02:13:50 +0000</pubDate><guid>https://baransel.dev/post/php-pdo-insert-new-row/</guid><description>We are preparing our line to insert with the binding method, and the insert method. This method returns the last added ID as a result.
&amp;lt;?php $name = &amp;#39;John Doe&amp;#39;; $email = &amp;#39;john@doe.com&amp;#39;; $password = md5(&amp;#39;johndoe&amp;#39;); $id = DB::insert(&amp;#39;INSERT INTO users (name, email, password) VALUES (?, ?, ?)&amp;#39;, [$name, $email, $password]); echo &amp;#39;User ID: &amp;#39; . $id; ?</description></item><item><title>Return multiple rows in PDO PHP</title><link>https://baransel.dev/post/php-pdo-return-multiple-row/</link><pubDate>Sun, 07 Feb 2021 02:13:50 +0000</pubDate><guid>https://baransel.dev/post/php-pdo-return-multiple-row/</guid><description>There are two different methods for listing the contents in the table. You can assign the whole result to a variable by using either the default query method of PDO or the get method in the class.
&amp;lt;?php $books = DB::get(&amp;#39;SELECT * FROM books ORDER BY price DESC LIMIT 30&amp;#39;); foreach($books as $book) { echo $book-&amp;gt;title . PHP_EOL; } ?</description></item><item><title>Return single row in PDO PHP</title><link>https://baransel.dev/post/php-pdo-return-single-row/</link><pubDate>Sat, 06 Feb 2021 02:13:50 +0000</pubDate><guid>https://baransel.dev/post/php-pdo-return-single-row/</guid><description>With the getRow method, we can get a row that will be returned by the query we wrote. Ideal for reaching the values of a member or a content.
&amp;lt;?php $user = DB::getRow(&amp;#39;SELECT * FROM users WHERE id = 1 LIMIT 1&amp;#39;); echo &amp;#39;Hello &amp;#39; . $user-&amp;gt;name . &amp;#39;!&amp;#39;; echo &amp;#39;E-mail address: &amp;#39; . $user-&amp;gt;email; ?</description></item><item><title>Return single value in PDO PHP</title><link>https://baransel.dev/post/php-pdo-return-single-value/</link><pubDate>Fri, 05 Feb 2021 02:13:50 +0000</pubDate><guid>https://baransel.dev/post/php-pdo-return-single-value/</guid><description>Let&amp;rsquo;s get to the main jokes of the class. With the getVar method, we get the only value returned by your query. For example, I want to take only one member&amp;rsquo;s name, or the total number of members.
&amp;lt;?php //A user&amp;#39;s name $name = DB::getVar(&amp;#39;SELECT name FROM users WHERE id = 1 LIMIT 1&amp;#39;); echo &amp;#39;Hello &amp;#39; . $name; //Or the total number of users $count = DB::getVar(&amp;#39;SELECT COUNT(id) FROM users&amp;#39;); echo &amp;#39;Total number of members &amp;#39; .</description></item><item><title>Using Bindings in PDO PHP</title><link>https://baransel.dev/post/php-pdo-using-bindings/</link><pubDate>Thu, 04 Feb 2021 02:13:50 +0000</pubDate><guid>https://baransel.dev/post/php-pdo-using-bindings/</guid><description>The query method in the example last post is a method that I combine with the PDO&amp;rsquo;s binding feature. If the first parameter is the query, the second parameter is the query. It is the sequence where we will give future values to the places we expressed with (question mark). A more extensive binding example;
&amp;lt;?php DB::query(&amp;#39;SELECT * FROM users WHERE id = ? AND name = ? AND email = ?</description></item><item><title>Why I don't use Frameworks</title><link>https://baransel.dev/post/reasons-why-i-dont-use-frameworks/</link><pubDate>Thu, 04 Feb 2021 02:13:50 +0000</pubDate><guid>https://baransel.dev/post/reasons-why-i-dont-use-frameworks/</guid><description>Let&amp;rsquo;s take a look at the downsides.
Slower Execution &amp;amp; Executes The Same Code Repeatedly Without Need
It is slower than pure (plain coding). This is because it contains a lot more architecture and features.
General Solutions for Specific Problems
PHP&amp;rsquo;s creator, Rasmus Lerdorf, has said:
Nobody has a general problem. Everyone has a very specific problem they’re trying to solve. And a general purpose framework, while it can solve it, usually solves it in a way that you get so many other things that you don’t need.</description></item><item><title>No more SQL Injections in PDO PHP</title><link>https://baransel.dev/post/php-pdo-no-more-sql-injection/</link><pubDate>Wed, 03 Feb 2021 02:13:50 +0000</pubDate><guid>https://baransel.dev/post/php-pdo-no-more-sql-injection/</guid><description>Almost all amateur PHP and MySQL projects have SQL injection vulnerability. However, thanks to PDO&amp;rsquo;s binding feature, variable values in the query are included externally and escape characters are added. In this way, we are free from this simple gap. We can run the following query without fear.
&amp;lt;?php $post = DB::query(&amp;#39;SELECT * FROM posts WHERE id = ?&amp;#39;, array($_GET[&amp;#39;id&amp;#39;])); ?</description></item><item><title>How to close PDO Connection in PHP</title><link>https://baransel.dev/post/php-how-to-close-pdo-connection/</link><pubDate>Sun, 27 Dec 2020 02:13:50 +0000</pubDate><guid>https://baransel.dev/post/php-how-to-close-pdo-connection/</guid><description>As with the old MySQL connection, even if you do not close the connection you opened, PHP automatically disconnects at the end of the process. But if you say I will close it, it is enough to define &amp;ldquo;null&amp;rdquo;.
&amp;lt;?php // we opened the connection $db = new PDO(&amp;#39;mysql:host=localhost;dbname=test&amp;#39;, $user, $pass); // we closed the connection $db = null; ?</description></item><item><title>How to undo queries in PHP PDO</title><link>https://baransel.dev/post/php-how-to-undo-queries-in-pdo/</link><pubDate>Sat, 26 Dec 2020 02:13:50 +0000</pubDate><guid>https://baransel.dev/post/php-how-to-undo-queries-in-pdo/</guid><description>Another important feature of PDO is that it can undo or apply the queries, which are expressed as transaction, when desired.
Before using the query expressions, we need to state that we started writing queries that we can undo by calling the beginTransaction method.
After running the BeginTransaction method, all the add, edit and delete queries we write continue to work as we normally use them. If we want to retrieve all queries in this range while the queries continue, we call the rollBack method.</description></item><item><title>Adding new record with PHP PDO</title><link>https://baransel.dev/post/php-adding-new-record-with-pdo/</link><pubDate>Fri, 25 Dec 2020 02:13:50 +0000</pubDate><guid>https://baransel.dev/post/php-adding-new-record-with-pdo/</guid><description>We will use the exec method to add a new record. Then, if we want to get the ID of the line we added, we will call the lastInsertId method. If there is a problem while adding, the exec method will return false. For this reason, we can first check whether it is added or not, and then print the ID on the screen
&amp;lt;?php if($db-&amp;gt;exec(&amp;#39;INSERT INTO users (name) VALUES (&amp;#34;Baransel&amp;#34;)&amp;#39;)) { $id = $db-&amp;gt;lastInsertId(); echo &amp;#39;ID of the newly added member: &amp;#39; .</description></item><item><title>Listing single row data with PHP PDO</title><link>https://baransel.dev/post/php-listing-single-row-with-pdo/</link><pubDate>Thu, 24 Dec 2020 02:13:50 +0000</pubDate><guid>https://baransel.dev/post/php-listing-single-row-with-pdo/</guid><description>For this, after calling our query with query, we will get the first result with fetch.
&amp;lt;?php $row = $db-&amp;gt;query(&amp;#39;SELECT * FROM users WHERE id = 1&amp;#39;)-&amp;gt;fetch(); echo $row[&amp;#39;name&amp;#39;]; ?</description></item><item><title>Listing data with PHP PDO</title><link>https://baransel.dev/post/php-listing-data-with-pdo/</link><pubDate>Tue, 22 Sep 2020 02:13:50 +0000</pubDate><guid>https://baransel.dev/post/php-listing-data-with-pdo/</guid><description>For this, we will use the query method I mentioned before.
&amp;lt;?php foreach($db-&amp;gt;query(&amp;#39;SELECT * FROM users&amp;#39;) as $row) { echo $row[&amp;#39;name&amp;#39;] . &amp;#39;&amp;lt;br/&amp;gt;&amp;#39;; } ?</description></item><item><title>Including variables in queries PDO PHP</title><link>https://baransel.dev/post/php-pdo-including-variables-in-queries/</link><pubDate>Tue, 30 Jun 2020 02:13:50 +0000</pubDate><guid>https://baransel.dev/post/php-pdo-including-variables-in-queries/</guid><description>Thanks to the binding method, which is one of the most important features of PDO, we can place our variables safely and properly in the queries we prepare.
For this, firstly, we will prepare our query with the prepare method, and we place &amp;ldquo;?&amp;rdquo; (question mark). Afterwards, we send our values to the questioned places with the execute method to the query we prepared.
&amp;lt;?php // We are preparing our query $query = $db-&amp;gt;prepare(&amp;#39;INSERT INTO users (name, email) VALUES(?</description></item><item><title>Sending a query with PDO in PHP</title><link>https://baransel.dev/post/php-sending-a-query-with-pdo/</link><pubDate>Wed, 22 Apr 2020 02:13:50 +0000</pubDate><guid>https://baransel.dev/post/php-sending-a-query-with-pdo/</guid><description>If we do not expect to get a result from the query we will make, we should use the &amp;ldquo;exec&amp;rdquo; method, if a result is desired, the query method. In summary; &amp;ldquo;Query&amp;rdquo; for our queries such as &amp;ldquo;DELETE / UPDATE / INSERT&amp;rdquo;, &amp;ldquo;query&amp;rdquo; for our queries such as &amp;ldquo;SELECT&amp;rdquo;.
&amp;lt;?php try { $db = new PDO(&amp;#39;mysql:host=localhost;dbname=test&amp;#39;, $user, $password); $db-&amp;gt;exec(&amp;#39;SET NAMES `UTF-8`&amp;#39;); $count = $db-&amp;gt;exec(&amp;#39;DELETE FROM messages WHERE old = 1&amp;#39;); echo $count .</description></item><item><title>PDO managing query errors in PHP</title><link>https://baransel.dev/post/php-pdo-managing-query-errors/</link><pubDate>Tue, 21 Apr 2020 02:13:50 +0000</pubDate><guid>https://baransel.dev/post/php-pdo-managing-query-errors/</guid><description>Methods that we send queries such as query or exec return false if they encounter an error when they execute the query. We will use the errorInfo method to reach the error messages of these unsuccessful queries.
This method returns an array containing the code and the message of the error in our last query. In this series with 3 elements, the 0th and 1st element give error codes, and the 2nd element gives the error message.</description></item><item><title>How to connect to MySQL with PDO in PHP</title><link>https://baransel.dev/post/how-to-connect-mysql-with-pdo/</link><pubDate>Mon, 20 Apr 2020 02:13:50 +0000</pubDate><guid>https://baransel.dev/post/how-to-connect-mysql-with-pdo/</guid><description>In general, when defining a PDO class, we specify the connection events with a DSN, or &amp;ldquo;Data Source Name&amp;rdquo;. We express which database driver we will connect to and our information with DSN. In the other two parameters, we enter our database username and password.
&amp;lt;?php $db = new PDO(&amp;#39;mysql:host=localhost;dbname=test&amp;#39;, $user, $pass); ?&amp;gt;For DSN statements of other drivers, see here.
&amp;lt;?php $dsn = &amp;#39;mysql:host=localhost;dbname=test&amp;#39;; $user = &amp;#39;dbuser&amp;#39;; $password = &amp;#39;mypassword&amp;#39;; try { $db = new PDO($dsn, $user, $password); } catch (PDOException $e) { echo &amp;#39;Connection failed: &amp;#39; .</description></item><item><title>What is PDO in PHP</title><link>https://baransel.dev/post/php-what-is-pdo/</link><pubDate>Sun, 19 Apr 2020 02:13:50 +0000</pubDate><guid>https://baransel.dev/post/php-what-is-pdo/</guid><description>PDO (PHP Data Objects / PHP Data Objects) in a nutshell; an interface that provides lightweight and consistent access to the database. As you can see from its name, it supports dozens of database drivers with “Object Oriented Programming” interface;
Cubrid FreeTDS / Microsoft SQL Server / Sybase Firebird/Interbase 6 IBM DB2 IBM Informix Dynamic Server MySQL 3.x/4.x/5.x Oracle Call Interface ODBC v3 (IBM DB2, unixODBC and win32 ODBC) PostgreSQL SQLite 3 and SQLite 2 Microsoft SQL Server / SQL Azure If you want to switch to a different database driver in the future, instead of changing your system fundamentally, you can do this job with some modifications from where you left off with PDO.</description></item><item><title>How to use switch statements in PHP</title><link>https://baransel.dev/post/php-switch-statment/</link><pubDate>Sat, 08 Feb 2020 02:13:50 +0000</pubDate><guid>https://baransel.dev/post/php-switch-statment/</guid><description>An expression that can be used only when you want to check one or more equations. The same thing you can do with the switch can be done with else if, but if you want to use an expression only when comparing one or more equations, the switch is more suitable for this operation.
&amp;lt;?php // when we want to do with if: if ($fruit === &amp;#39;watermelon&amp;#39;) { echo &amp;#39;watermelon selected&amp;#39;; } else if ($fruit === &amp;#39;strawberry&amp;#39;) { echo &amp;#39;strawberry selected&amp;#39;; } else if ($fruit === &amp;#39;pear&amp;#39;) { echo &amp;#39;pear selected&amp;#39;; } // let&amp;#39;s do the same with the switch: switch ($fruit) {// express the variable to compare case &amp;#39;watermelon&amp;#39;: // if it is equal to watermelon echo &amp;#39;watermelon selected&amp;#39;; break; // continue comparison if this option matches case &amp;#39;strawberry&amp;#39;: echo &amp;#39;strawberry selected&amp;#39;; break; case &amp;#39;pear&amp;#39;: echo &amp;#39;pear selected&amp;#39;; break; } ?</description></item><item><title>How to apply elseif conditions in PHP</title><link>https://baransel.dev/post/php-elseif-expression/</link><pubDate>Fri, 07 Feb 2020 02:13:50 +0000</pubDate><guid>https://baransel.dev/post/php-elseif-expression/</guid><description>If not, it meant if, if it meant, that means &amp;ldquo;if not&amp;rdquo;. If a condition does not match with this statement, we can try another condition immediately after. For example, let&amp;rsquo;s make a score assessment with elseif. If our grade is 5, then let&amp;rsquo;s print very good if it is 4, good if it is 3, middle and if it is 2 or 1 print failed.
&amp;lt;?php $grade = 5; if($grade === 5) { echo &amp;#39;Very good!</description></item><item><title>How to apply else conditions in PHP</title><link>https://baransel.dev/post/php-else-conditions/</link><pubDate>Sun, 26 Jan 2020 02:13:50 +0000</pubDate><guid>https://baransel.dev/post/php-else-conditions/</guid><description>if the conditions are positive, we can run another block of code even if the conditions are not met by using else while running the codes in the parentheses {…}.
Let&amp;rsquo;s show by applying on our example:
&amp;lt;?php $a = 200; if($a &amp;gt; 0 &amp;amp;&amp;amp; $a &amp;lt; 100) { echo &amp;#39;$a variable is between 0-100&amp;#39;; } else { echo &amp;#39;$a variable is NOT between 0-100&amp;#39;; } ?&amp;gt;Here, if the conditions are not correct, we said write $a variable NOT between 0-100.</description></item><item><title>How to apply multiple if conditions in PHP</title><link>https://baransel.dev/post/php-apply-multiple-if-conditions/</link><pubDate>Sat, 25 Jan 2020 02:13:50 +0000</pubDate><guid>https://baransel.dev/post/php-apply-multiple-if-conditions/</guid><description>With logical operators, we can make multiple comparisons into if. Let&amp;rsquo;s show this example that we have given in logical operators using if.
&amp;lt;?php $a = 10; if($a &amp;gt; 0 &amp;amp;&amp;amp; $a &amp;lt; 100) { echo &amp;#39;$a variable is between 0-100&amp;#39;; } ?&amp;gt;Here, if the variable $a is greater than 0 and $a is less than 100, we said run the following codes. And since we give 10 to the value of the variable $a, it will write the variable $a is between 0-100 on the screen.</description></item><item><title>What is the if statements in PHP and how to use it</title><link>https://baransel.dev/post/php-if-statements/</link><pubDate>Fri, 24 Jan 2020 02:13:50 +0000</pubDate><guid>https://baransel.dev/post/php-if-statements/</guid><description>In PHP, we can make decisions on our codes with if. We need a condition for the if statement that means we need the code we want it to do as a result of the condition.
The basic form of If is:
&amp;lt;?php if (condition) { // codes to work if the condition is positive } ?&amp;gt;Let&amp;rsquo;s explain and show with an example:
&amp;lt;?php $a = 20; if ($a &amp;gt; 10) { echo &amp;#39;variable is greater than 10&amp;#39;; } ?</description></item><item><title>What is the error suppression operator in PHP.</title><link>https://baransel.dev/post/php-error-suppression-operator/</link><pubDate>Wed, 22 Jan 2020 02:13:50 +0000</pubDate><guid>https://baransel.dev/post/php-error-suppression-operator/</guid><description>The error suppression operator (@) is the at sign. It can be used before every statement. When you put this at the beginning of the places that will create errors, it does not cause an error output on the screen.
It serves to ignore the error and not to make the result negative.
Let&amp;rsquo;s say we have a division process, maybe we can write the number 0 in this division process.</description></item><item><title>What is the logical operators in PHP.</title><link>https://baransel.dev/post/php-logical-operators/</link><pubDate>Tue, 21 Jan 2020 02:13:50 +0000</pubDate><guid>https://baransel.dev/post/php-logical-operators/</guid><description>We can evaluate and combine multiple comparisons with logical operators. For example, we make a comparison of whether a variable is greater than 0 or less than 100 thanks to logical operators.
Let&amp;rsquo;s show the logical operators in a table:
Operator Name Usage Explanation ! Negative !$a Returns true if the value of $a is negative, or the other way around. &amp;amp;&amp;amp; And $a &amp;amp;&amp;amp; $b If the value of $a and $b is positive, TRUE returns positive, if either is negative, returns FALSE.</description></item><item><title>What is the comparison operators in PHP.</title><link>https://baransel.dev/post/php-comparision-operators/</link><pubDate>Sun, 19 Jan 2020 02:13:50 +0000</pubDate><guid>https://baransel.dev/post/php-comparision-operators/</guid><description>Comparison operators will compare multiple values among themselves on the name. For example, is a variable in $a the same as $b? Or bigger? We will make comparisons with these operators.
Let&amp;rsquo;s show the comparison operators on a table:
Operator Name Usage == Equal $a == $b === Equivalent $a === $b != Not equal $a != $b !</description></item><item><title>How to increase or decrease value in PHP</title><link>https://baransel.dev/post/php-decrease-increase-value/</link><pubDate>Sat, 18 Jan 2020 02:13:50 +0000</pubDate><guid>https://baransel.dev/post/php-decrease-increase-value/</guid><description>We use the double plus (++) operator to increment the numeric value in a variable and the double minus (&amp;ndash;) operator to subtract a value.
Sample usage:
&amp;lt;?php $a = 10; $a++; echo $a; ?&amp;gt;It will print 11. We increased the value of $a by 1 and printed it on the screen.</description></item><item><title>What is the assignment operator in PHP and how to use it.</title><link>https://baransel.dev/post/php-assignment-operator/</link><pubDate>Fri, 17 Jan 2020 02:13:50 +0000</pubDate><guid>https://baransel.dev/post/php-assignment-operator/</guid><description>We assign values to variables with assignment operators. The base assignment operator is equal (=). I assume that you understand this in the examples and narratives that pass. A single equal sign allows us to assign the desired value to the desired variable.
Let&amp;rsquo;s show the other operators on a table. These operators are unified assignment operators. These add a value to the end of a variable or make it easier for us to add a number to the result in the variable.</description></item><item><title>What is the escape operator in PHP and how to use it.</title><link>https://baransel.dev/post/php-escape-operator/</link><pubDate>Thu, 16 Jan 2020 02:13:50 +0000</pubDate><guid>https://baransel.dev/post/php-escape-operator/</guid><description>The escape operator is the opposite section sign “\”.
Here is an example of the escape operator:
&amp;lt;?php $message = &amp;#34;Fee: 100\$&amp;#34;; echo $message; ?&amp;gt;Fee: 100$. We used the $ dollar sign with double quotes, but put a reverse sign at the beginning. Therefore, it did not perceive the dollar sign as a variable.
Because we use variables in double quotes, we can also use this operator to avoid the $ dollar sign when writing something containing double quotes in double quotes.</description></item><item><title>Difference between single quotes and double quotes in PHP</title><link>https://baransel.dev/post/difference-between-single-quotes-and-double-quotes-php/</link><pubDate>Fri, 10 Jan 2020 02:13:50 +0000</pubDate><guid>https://baransel.dev/post/difference-between-single-quotes-and-double-quotes-php/</guid><description>Finally, I will talk about a little different path that we need to pay attention to. This means that there are some usage differences between “(double quotes) and ‘(single quotes) in PHP. We cannot write a variable in the values that we will give with single quotes, let&amp;rsquo;s show by example:
&amp;lt;?php $name = &amp;#39;Baransel&amp;#39;; $message = &amp;#39;Hello $name&amp;#39;; echo $message; ?&amp;gt;The screen displays Hello $name. Because we wrote the variable in single quotes.</description></item><item><title>What are the string operators in PHP</title><link>https://baransel.dev/post/php-string-operators/</link><pubDate>Thu, 09 Jan 2020 02:13:50 +0000</pubDate><guid>https://baransel.dev/post/php-string-operators/</guid><description>I actually used this operator to add two or more characters consecutively, as an example before a few blog posts. You may not have understood there. But now we&amp;rsquo;ll correct this lack.
We will use the “.”(Dot) operator to combine texts and other values side by side and add them to other values. Let me show you an example again:
&amp;lt;?php $name = &amp;#39;Baransel&amp;#39;; $message = &amp;#39;Hello&amp;#39;; $result = $message. $name; echo $result; ?</description></item><item><title>What are the arithmetic operators in PHP</title><link>https://baransel.dev/post/php-arithmetic-operators/</link><pubDate>Wed, 08 Jan 2020 02:13:50 +0000</pubDate><guid>https://baransel.dev/post/php-arithmetic-operators/</guid><description>Arithmetic operators are simple. What we learned in elementary school, you can call them mathematical operators. With these operators, you can add, subtract, divide and multiply the values you want.
Here are the arithmetic operators, names and examples in PHP:
Operator Name Example + Addition $a + $b – Subtraction $a - $b * Multiplication $a * $b / Division $a / $b % Module $a % $b Let&amp;rsquo;s show them an example:</description></item><item><title>Check if session exists in PHP</title><link>https://baransel.dev/post/php-check-if-session-exists/</link><pubDate>Tue, 07 Jan 2020 02:13:50 +0000</pubDate><guid>https://baransel.dev/post/php-check-if-session-exists/</guid><description>In other studies, we used the isset() function to check its existence. This function returns a positive if there is a session or a negative.
&amp;lt;?php session_start(); echo isset($_SESSION [&amp;#39;test&amp;#39;]); ?</description></item><item><title>How to delete all sessions in PHP</title><link>https://baransel.dev/post/php-deleting-all-sessions/</link><pubDate>Mon, 06 Jan 2020 02:13:50 +0000</pubDate><guid>https://baransel.dev/post/php-deleting-all-sessions/</guid><description>For this, we will use session_destroy(). This function destroys all defined sessions.
&amp;lt;?php session_start(); session_destroy(); ?</description></item><item><title>How to delete session in PHP</title><link>https://baransel.dev/post/php-deleting-session/</link><pubDate>Sat, 04 Jan 2020 02:13:50 +0000</pubDate><guid>https://baransel.dev/post/php-deleting-session/</guid><description>As mentioned earlier, we also use the unset() function in session deletion.
&amp;lt;?php session_start(); $_SESSION[&amp;#39;planet&amp;#39;] = &amp;#39;Earth&amp;#39;; unset($_SESSION[&amp;#39;planet&amp;#39;]); ?&amp;gt;Above, we created a session and then deleted it.</description></item><item><title>How to assign an array inside session in PHP</title><link>https://baransel.dev/post/php-assigning-array-into-session/</link><pubDate>Fri, 03 Jan 2020 02:13:50 +0000</pubDate><guid>https://baransel.dev/post/php-assigning-array-into-session/</guid><description>As well as assigning values to sessions, such as numbers, we can also assign arrays. To do that, you just have to pretend to be an ordinary array.
Session array example:
&amp;lt;?php session_start(); $_SESSION[&amp;#39;members&amp;#39;] = array (&amp;#39;Baransel&amp;#39;, &amp;#39;John&amp;#39;, &amp;#39;Andrew&amp;#39;); ?&amp;gt;In this way, we can move the array data in the sessions. And when we call it on other pages, we can continue to use it exactly as an array.</description></item><item><title>How to create a session in PHP</title><link>https://baransel.dev/post/php-creating-sessions/</link><pubDate>Thu, 02 Jan 2020 02:13:50 +0000</pubDate><guid>https://baransel.dev/post/php-creating-sessions/</guid><description>We can read, create, and delete sessions over a single $_SESSION global array. The only important issue is that we must write the session_start() function at the top of each page before we start using session, which prepares the session event and is essential.
On some servers, session usage is always on automatically, and if you try to write session_start() on open servers, it will fail. In this case there is no need to use this function.</description></item><item><title>How to see if cookie is defined in PHP</title><link>https://baransel.dev/post/php-see-if-cookie-is-defined/</link><pubDate>Sun, 29 Dec 2019 02:13:50 +0000</pubDate><guid>https://baransel.dev/post/php-see-if-cookie-is-defined/</guid><description>With the isset() function, which checks the existence of all variables, we can determine if a cookie is defined. The use of this function will be used with the if statement.
&amp;lt;?php echo isset($_COOKIE[&amp;#39;nothing&amp;#39;]); ?&amp;gt;If nothing is displayed, FALSE is returned. Because we did not define such a cookie. If there was a defined cookie, it would write 1 on the screen.</description></item><item><title>How to use change values of cookies in PHP</title><link>https://baransel.dev/post/php-change-cookie-values/</link><pubDate>Fri, 27 Dec 2019 02:13:50 +0000</pubDate><guid>https://baransel.dev/post/php-change-cookie-values/</guid><description>We use the setcookie() function to create and delete cookies as well as to change its value. And it is the same as changing its value as it is creating. Just type the name we have defined in the name of the cookie. The value is changed if the cookie is created if it does not exist.
&amp;lt;?php setcookie(&amp;#39;cookie&amp;#39;, &amp;#39;salute world&amp;#39;); setcookie(&amp;#39;cookie&amp;#39;, &amp;#39;hello world&amp;#39;); echo $_COOKIE[&amp;#39;cookie&amp;#39;]; ?&amp;gt;The screen will show hello world.</description></item><item><title>How to use cookies in PHP</title><link>https://baransel.dev/post/php-how-to-use-cookies/</link><pubDate>Thu, 26 Dec 2019 02:13:50 +0000</pubDate><guid>https://baransel.dev/post/php-how-to-use-cookies/</guid><description>The use of cookies is done through the $_COOKIE array. This array is based on cookies automatically sent to that page. We use the following code to access the cookie we created above, which shows how simple and straightforward it is:
&amp;lt;?php echo $_COOKIE[&amp;#39;cookie&amp;#39;]; ?&amp;gt;As a continuation of the above example on the screen, the screen will print out salute world.</description></item><item><title>How to delete cookies in PHP</title><link>https://baransel.dev/post/php-how-to-delete-cookies/</link><pubDate>Wed, 25 Dec 2019 02:13:50 +0000</pubDate><guid>https://baransel.dev/post/php-how-to-delete-cookies/</guid><description>To delete a cookie we use the setcookie() function as if it were a normal cookie. The only difference is that we enter a past expiry date in our 3rd expiry date. In this way, the cookie is expired and is deleted immediately. As an example we will show this cookie 1 hour before saying time() - 3600 and the cookie will be deleted:
&amp;lt;?php setcookie (&amp;#39;cookie&amp;#39;, &amp;#39;salute world&amp;#39;, time () - 3600); ?</description></item><item><title>What are cookies and how to create them</title><link>https://baransel.dev/post/php-what-are-cookies/</link><pubDate>Tue, 24 Dec 2019 02:13:50 +0000</pubDate><guid>https://baransel.dev/post/php-what-are-cookies/</guid><description>In PHP, we create a cookie with a setcookie() function. In the function, we specify the key and the contents of the value to be sent to the scanner and also specify how long it will be stored in the browser.
&amp;lt;?php setcookie (&amp;#39;cookie&amp;#39;, &amp;#39;salute world&amp;#39;); ?&amp;gt;In the example above, we created a cookie called cookie and we made the value salute world. And because we didn&amp;rsquo;t enter anything as parameter 3, by default the cookie will be deleted when the browser is closed.</description></item><item><title>Where to use Arrays in PHP</title><link>https://baransel.dev/post/php-where-to-use-arrays/</link><pubDate>Mon, 23 Dec 2019 02:13:50 +0000</pubDate><guid>https://baransel.dev/post/php-where-to-use-arrays/</guid><description>I can give you an example a little more about its use in your mind about it. For example, by placing similar types of data in a single variable, you can access all the data you need with a single variable:
&amp;lt;?php $message[&amp;#39;title&amp;#39;] = &amp;#39;Hello World!&amp;#39;; $message[&amp;#39;content&amp;#39;] = &amp;#39;Greetings, this is just an example to better understand arrays in PHP&amp;#39;; $message[&amp;#39;author&amp;#39;] = &amp;#39;Baransel&amp;#39;; $message[&amp;#39;date&amp;#39;] = &amp;#39;Thursday, December 23, 2010&amp;#39;; ?&amp;gt;As you can see, I just kept all the data of a message in a regular and separate way with only the $message variable.</description></item><item><title>Global array $_SERVER in PHP</title><link>https://baransel.dev/post/php-global-array-server/</link><pubDate>Fri, 20 Dec 2019 02:13:50 +0000</pubDate><guid>https://baransel.dev/post/php-global-array-server/</guid><description>The leading of these global variables is $_SERVER. We can access the server data and the IP address and browser data of the visitors.
To handle all the values of the $_SERVER array, let me tell you what it is by simply printing it to the screen with print_r():
Note: I have omitted some values that I do not need to explain and that you will not need to use yet.</description></item><item><title>Finding elements of arrays in PHP</title><link>https://baransel.dev/post/finding-elements-of-arrays-php/</link><pubDate>Thu, 19 Dec 2019 02:13:50 +0000</pubDate><guid>https://baransel.dev/post/finding-elements-of-arrays-php/</guid><description>We use the count() function to count how many elements are in an array. Let me show you a simple example:
&amp;lt;?php $colors = [&amp;#39;blue&amp;#39;, &amp;#39;orange&amp;#39;, &amp;#39;green&amp;#39;]; echo count($colors); ?&amp;gt;The display shows 3. Because $colors have 3 elements in the array.</description></item><item><title>How to print the entire array in PHP</title><link>https://baransel.dev/post/php-how-to-print-all-the-array/</link><pubDate>Wed, 18 Dec 2019 02:13:50 +0000</pubDate><guid>https://baransel.dev/post/php-how-to-print-all-the-array/</guid><description>If we really want to print an array as it is, we will use the print_r() function. This shows us all the keys and their values of the directory we&amp;rsquo;re writing:
&amp;lt;?php $colors = [&amp;#39;blue&amp;#39;, &amp;#39;orange&amp;#39;, &amp;#39;green&amp;#39;]; print_r($colors); ?&amp;gt;An output appears on the screen:
Array ( [0] =&amp;gt; blue [1] =&amp;gt; orange [2] =&amp;gt; green )</description></item><item><title>How to delete array in PHP</title><link>https://baransel.dev/post/php-how-to-delete-array/</link><pubDate>Tue, 17 Dec 2019 02:13:50 +0000</pubDate><guid>https://baransel.dev/post/php-how-to-delete-array/</guid><description>We use the unset() function, which we use to destroy variables to subtract or destroy one of the arrays you create. In fact, you can use this function to destroy all variable types.
&amp;lt;?php $fruits[0] = &amp;#39;Apple&amp;#39;; $fruits[1] = &amp;#39;Pear&amp;#39;; // just to delete an array: unset ($fruits[0]); // to delete all: unset ($fruits); ?</description></item><item><title>What is a nested array PHP</title><link>https://baransel.dev/post/php-what-is-nested-array/</link><pubDate>Mon, 16 Dec 2019 02:13:50 +0000</pubDate><guid>https://baransel.dev/post/php-what-is-nested-array/</guid><description>Immediately after creating an array, we can create more arrays in that array forever. You can think of it as subcategory logic. Again, you can do this with the function:
&amp;lt;?php $meal[&amp;#39;dessert&amp;#39;] = [&amp;#39;cake&amp;#39;, &amp;#39;cookies&amp;#39;, &amp;#39;sugar&amp;#39;]; $meal[&amp;#39;bitter&amp;#39;] = [&amp;#39;pepper&amp;#39;, &amp;#39;spicy adana&amp;#39;, &amp;#39;mexican sauce&amp;#39;]; echo &amp;#39;I ate &amp;#39;. $meal[&amp;#39;dessert&amp;#39;][0]; ?&amp;gt;The screen writes that I ate cake. You can create as many nested arrays as you want here. Let me show you another example:</description></item><item><title>How to change array values PHP</title><link>https://baransel.dev/post/php-how-to-change-array-values/</link><pubDate>Sat, 14 Dec 2019 02:13:50 +0000</pubDate><guid>https://baransel.dev/post/php-how-to-change-array-values/</guid><description>&amp;lt;?php $fruits[0] = &amp;#39;Apple&amp;#39;; $fruits[0] = &amp;#39;Orange&amp;#39;; echo $fruits [0]; ?&amp;gt;Orange appears on the screen. Because the value of the 0 key of the $fruits array was changed from Apple to Orange on the next line.
We&amp;rsquo;ve always shown it with numeric keys, now let me show it with the string keys:
&amp;lt;?php $guest[&amp;#39;name&amp;#39;] = &amp;#39;Baransel&amp;#39;; $guest[&amp;#39;age&amp;#39;] = 20; $guest[&amp;#39;country&amp;#39;] = &amp;#39;Romania&amp;#39;; echo &amp;#39;Guests name is &amp;#39; . $guest[&amp;#39;name&amp;#39;] . &amp;#39;, age is &amp;#39; .</description></item><item><title>What are arrays in PHP</title><link>https://baransel.dev/post/php-what-is-an-array/</link><pubDate>Fri, 13 Dec 2019 02:13:50 +0000</pubDate><guid>https://baransel.dev/post/php-what-is-an-array/</guid><description>You can create an array using the array() function or not.
First let me show you how to create with the array() function:
&amp;lt;?php $fruits = array (&amp;#39;Apple&amp;#39;, &amp;#39;Pear&amp;#39;, &amp;#39;Banana&amp;#39;, &amp;#39;Cherry&amp;#39;); ?&amp;gt;We have assigned 4 values to the array of $fruits with the array() function.
Let&amp;rsquo;s do the same without using a function:
&amp;lt;?php $fruits[0] = &amp;#39;Apple&amp;#39;; $fruits[1] = &amp;#39;Pear&amp;#39;; $fruits[2] = &amp;#39;Banana&amp;#39;; $fruits[3] = &amp;#39;Cherry&amp;#39;; ?&amp;gt;In the non-functional method, how the array actually results is revealed.</description></item><item><title>What are PHP Constants</title><link>https://baransel.dev/post/php-constants/</link><pubDate>Thu, 12 Dec 2019 02:13:50 +0000</pubDate><guid>https://baransel.dev/post/php-constants/</guid><description>PHP constants are used to define the values that will remain constant without changing the name of the variable. In addition, the constants are safe only because they cannot be defined and changed once.
Defining constants is done with define() function. It is implemented with two arguments.
Sample:
&amp;lt;?php define (&amp;#39;site_name&amp;#39;, &amp;#39;baransel.dev&amp;#39;); // We created a constant named site_name and set its value to baransel.dev ?&amp;gt;The names we use for the constants are the same as the names of the variables.</description></item><item><title>Assigning, editing, and deleting variables in PHP</title><link>https://baransel.dev/post/php-assigning-editing-and-deleting-variables/</link><pubDate>Wed, 11 Dec 2019 02:13:50 +0000</pubDate><guid>https://baransel.dev/post/php-assigning-editing-and-deleting-variables/</guid><description>We do a value assignment with the “=” operator, which we learned logically and mathematically in primary school.
This equals event is the same in all current programming languages. This means that in most programming languages of today, value assignment and editing is done with this operator. Because the way of reason is one.
Now let&amp;rsquo;s assign the newspaper value to the $mail_box variable;
&amp;lt;?php $mail_box = &amp;#39;newspaper&amp;#39;; echo $mail_box; ?</description></item><item><title>What are PHP Variables</title><link>https://baransel.dev/post/php-variables/</link><pubDate>Tue, 10 Dec 2019 02:13:50 +0000</pubDate><guid>https://baransel.dev/post/php-variables/</guid><description>In PHP, we specify variables with a dollar ($) sign. Even here you can deduce that PHP is a very rich language.
A list of rules that you must follow when defining a variable;
You cannot use characters other than letters, numbers, and underscores (_).
You cannot initialize the variable name with a number. ($1 variable is false, $variable1 is true)
PHP distinguishes variable names, so $variable is not the same as $VaRiAbLe.</description></item><item><title>Apps - Baransel Arslan</title><link>https://baransel.dev/apps/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://baransel.dev/apps/</guid><description/></item><item><title>Baransel Arslan - Contact me</title><link>https://baransel.dev/contact/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://baransel.dev/contact/</guid><description/></item><item><title>Baransel Arslan - CV</title><link>https://baransel.dev/cv/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://baransel.dev/cv/</guid><description/></item><item><title>Baransel Arslan - Search</title><link>https://baransel.dev/search/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://baransel.dev/search/</guid><description/></item><item><title>Baransel Arslan - Sign up to my newsletter!</title><link>https://baransel.dev/newsletter/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://baransel.dev/newsletter/</guid><description/></item></channel></rss>