<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Muhammad Shoaib</title>
    <description>The latest articles on DEV Community by Muhammad Shoaib (@imuhammadshoaib).</description>
    <link>https://dev.to/imuhammadshoaib</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F443287%2F3cc61a6f-e924-4f98-b1a8-ca018218f97b.png</url>
      <title>DEV Community: Muhammad Shoaib</title>
      <link>https://dev.to/imuhammadshoaib</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/imuhammadshoaib"/>
    <language>en</language>
    <item>
      <title>From Cloud to Local: My LLM Journey</title>
      <dc:creator>Muhammad Shoaib</dc:creator>
      <pubDate>Mon, 20 Jan 2025 08:20:19 +0000</pubDate>
      <link>https://dev.to/imuhammadshoaib/from-cloud-to-local-my-llm-journey-48fj</link>
      <guid>https://dev.to/imuhammadshoaib/from-cloud-to-local-my-llm-journey-48fj</guid>
      <description>&lt;p&gt;Like many developers, my AI journey began with ChatGPT, but the landscape has evolved dramatically since then. Let me share my experience navigating through various LLM providers and tools that have transformed my workflow.&lt;/p&gt;

&lt;h1&gt;
  
  
  Cloud Providers to Local Solutions
&lt;/h1&gt;

&lt;p&gt;I started with ChatGPT for basic coding assistance, then moved to Claude by Anthropic for its improved reasoning and technical capabilities. While both are excellent, I wanted more control and faster response times, which led me to explore local solutions.&lt;/p&gt;

&lt;h1&gt;
  
  
  The Game Changers
&lt;/h1&gt;

&lt;p&gt;The real breakthrough came when I discovered these powerful tools:&lt;/p&gt;

&lt;h3&gt;
  
  
  LM Studio:
&lt;/h3&gt;

&lt;p&gt;A desktop application that lets me run open-source LLMs locally. The ability to switch between different models and run them offline has been invaluable.&lt;/p&gt;

&lt;h3&gt;
  
  
  Hyperbolic:
&lt;/h3&gt;

&lt;p&gt;Their specialized models for coding tasks have impressed me with their performance and efficiency.&lt;/p&gt;

&lt;h3&gt;
  
  
  Together AI:
&lt;/h3&gt;

&lt;p&gt;Their infrastructure made deploying and using various open-source models much more accessible, with competitive pricing for higher volumes.&lt;/p&gt;

&lt;h3&gt;
  
  
  Qwen 2.5:
&lt;/h3&gt;

&lt;p&gt;My current go-to for code-specific tasks, running locally with impressive performance.&lt;/p&gt;

&lt;h1&gt;
  
  
  IDE Integration: The Missing Piece
&lt;/h1&gt;

&lt;p&gt;The game-changer in my workflow was Continue, a VS Code extension that brings LLM capabilities directly into my development environment. It integrates with various providers and local models, offering:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Real-time code suggestions&lt;/li&gt;
&lt;li&gt;Documentation generation&lt;/li&gt;
&lt;li&gt;Code explanations&lt;/li&gt;
&lt;li&gt;Refactoring assistance&lt;/li&gt;
&lt;/ul&gt;

&lt;h1&gt;
  
  
  Current Setup
&lt;/h1&gt;

&lt;p&gt;Today, I run a hybrid setup: Qwen locally for coding tasks through Continue in VS Code, Claude for complex problem-solving, and various specialized models through LM Studio for specific needs. This combination gives me the best of both worlds - the convenience of cloud services and the speed of local execution.&lt;/p&gt;

&lt;p&gt;The LLM landscape continues to evolve, and I'm excited to see what new tools and capabilities emerge.&lt;/p&gt;

</description>
      <category>llm</category>
      <category>ai</category>
      <category>openai</category>
      <category>webdev</category>
    </item>
    <item>
      <title>AI, Machine Learning, Deep Learning, and Generative AI: What’s the Difference?</title>
      <dc:creator>Muhammad Shoaib</dc:creator>
      <pubDate>Fri, 03 Jan 2025 07:41:27 +0000</pubDate>
      <link>https://dev.to/imuhammadshoaib/ai-machine-learning-and-deep-learning-whats-the-difference-ej7</link>
      <guid>https://dev.to/imuhammadshoaib/ai-machine-learning-and-deep-learning-whats-the-difference-ej7</guid>
      <description>&lt;p&gt;Hey there! Today, I want to break down three popular terms you might have heard: Artificial Intelligence (AI), Machine Learning (ML), and Deep Learning (DL). These concepts often get mixed up, but they’re not the same thing. Let’s dive in!&lt;/p&gt;

&lt;h1&gt;
  
  
  What is AI?
&lt;/h1&gt;

&lt;p&gt;Artificial Intelligence is all about creating machines that can do things that usually require human intelligence. This includes tasks like understanding language, recognizing faces in photos, or even driving a car. Think of AI as a way to make computers and devices smarter.&lt;/p&gt;

&lt;h2&gt;
  
  
  Types of AI
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Narrow AI:
&lt;/h3&gt;

&lt;p&gt;This is the type of AI we see in our everyday lives. It’s designed for specific tasks, like Siri answering your questions or Netflix suggesting movies you might like. It does one job really well but doesn’t think for itself outside of that.&lt;/p&gt;

&lt;h3&gt;
  
  
  General AI:
&lt;/h3&gt;

&lt;p&gt;This is more of a futuristic idea. Imagine if a computer could think and learn just like a human in all areas. We’re not there yet, and it’s more of a concept we see in movies for now.&lt;/p&gt;

&lt;h3&gt;
  
  
  Examples of AI:
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Virtual Assistants:&lt;/strong&gt; Siri and Google Assistant help you set reminders or answer questions.&lt;br&gt;
&lt;strong&gt;Recommendation Systems:&lt;/strong&gt; Netflix and Spotify suggest movies and music based on your preferences.&lt;br&gt;
&lt;strong&gt;Autonomous Vehicles:&lt;/strong&gt; Self-driving cars use AI to navigate and make decisions.&lt;/p&gt;

&lt;h1&gt;
  
  
  What About ML?
&lt;/h1&gt;

&lt;p&gt;Machine Learning is a part of AI that focuses on teaching computers to learn from experience. Instead of telling a computer exactly what to do every time, we give it lots of data and let it figure things out on its own.&lt;/p&gt;

&lt;h2&gt;
  
  
  Types of Machine Learning
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Supervised Learning:
&lt;/h3&gt;

&lt;p&gt;This is like teaching a child with examples. For instance, if you want to teach a computer to recognize cats in pictures, you show it lots of cat photos and tell it, "This is a cat." Over time, the computer learns to identify cats on its own.&lt;/p&gt;

&lt;h3&gt;
  
  
  Unsupervised Learning:
&lt;/h3&gt;

&lt;p&gt;In this case, the computer looks at data without any labels. It tries to find patterns by itself. Imagine sorting a box of mixed-up toys without knowing what each toy is—eventually, you might group them by color or size.&lt;/p&gt;

&lt;h3&gt;
  
  
  Reinforcement Learning:
&lt;/h3&gt;

&lt;p&gt;This is like training a pet. The computer learns by trying things out and getting feedback. If it does something right, it gets a reward; if it does something wrong, it learns not to do it again.&lt;/p&gt;

&lt;h3&gt;
  
  
  Examples of ML:
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Spam Detection:&lt;/strong&gt; Email services use ML to filter out spam messages.&lt;br&gt;
&lt;strong&gt;Image Recognition:&lt;/strong&gt; Facebook uses ML to tag people in photos automatically.&lt;br&gt;
&lt;strong&gt;Predictive Analytics:&lt;/strong&gt; Companies use ML to forecast sales or customer behavior.&lt;/p&gt;

&lt;h1&gt;
  
  
  What is Deep Learning?
&lt;/h1&gt;

&lt;p&gt;Deep Learning is a special kind of Machine Learning that uses structures called neural networks—think of them as layers of interconnected nodes that mimic how our brains work. Deep Learning excels at processing large amounts of data and can tackle complex problems like image and speech recognition.&lt;/p&gt;

&lt;h3&gt;
  
  
  Why is Deep Learning Important?
&lt;/h3&gt;

&lt;p&gt;Handling Big Data: Deep Learning can analyze vast amounts of data quickly and effectively. This makes it great for tasks like recognizing faces in photos or translating languages in real time.&lt;/p&gt;

&lt;h3&gt;
  
  
  Automation:
&lt;/h3&gt;

&lt;p&gt;It can automate tasks that were once thought to need human intelligence, like driving a car or diagnosing medical conditions.&lt;/p&gt;

&lt;h3&gt;
  
  
  Examples of DL:
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Voice Assistants:&lt;/strong&gt; Systems like Amazon Alexa use deep learning for voice recognition.&lt;br&gt;
&lt;strong&gt;Self-Driving Cars:&lt;/strong&gt; Tesla’s Autopilot uses deep learning to analyze road conditions.&lt;br&gt;
&lt;strong&gt;Medical Imaging:&lt;/strong&gt; DL algorithms assist in diagnosing diseases from medical scans.&lt;/p&gt;

&lt;h1&gt;
  
  
  Generative AI
&lt;/h1&gt;

&lt;p&gt;Generative AI, often associated with generative AI, are large-scale models trained on diverse datasets. They can generate text, images, and other content based on the input they receive. This technology has made significant strides in recent years, enabling applications like chatbots, art generation, and even code writing.&lt;/p&gt;

&lt;h3&gt;
  
  
  Why Do Generative AI Matter?
&lt;/h3&gt;

&lt;p&gt;Versatility: They can be used for a wide range of tasks without needing extensive retraining for each specific application.&lt;br&gt;
Creativity: Generative AI can produce creative content, such as art and music, opening new avenues for creativity and innovation.&lt;/p&gt;

&lt;h3&gt;
  
  
  Examples of Generative AI:
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;ChatGPT:&lt;/strong&gt; A model that generates human-like text responses based on prompts.&lt;br&gt;
&lt;strong&gt;DALL-E:&lt;/strong&gt; An AI that creates images from textual descriptions.&lt;br&gt;
&lt;strong&gt;Music Generation:&lt;/strong&gt; AI tools like OpenAI’s MuseNet create original music compositions.&lt;/p&gt;

&lt;h1&gt;
  
  
  Why Does It Matter?
&lt;/h1&gt;

&lt;p&gt;Understanding the differences between AI, ML, DL, and Generative AI models can help you appreciate the technology around you. When you ask your virtual assistant a question, that’s AI working. When it gets better at answering you over time, thanks to your interactions, that’s the magic of ML. When it recognizes your face in a photo, that’s Deep Learning at play. And when it generates text or images for you, that’s the power of generative AI.&lt;/p&gt;

&lt;h2&gt;
  
  
  In short:
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;AI&lt;/strong&gt; is the broad concept of machines simulating human intelligence.&lt;br&gt;
&lt;strong&gt;ML&lt;/strong&gt; is a subset of AI that teaches machines to learn from data.&lt;br&gt;
&lt;strong&gt;DL&lt;/strong&gt; is a subset of ML that uses neural networks to analyze complex data.&lt;br&gt;
&lt;strong&gt;Generative AI&lt;/strong&gt; are large models that can generate diverse outputs and adapt to various tasks.&lt;/p&gt;

&lt;p&gt;Thanks for reading! I hope this helps clear things up. If you have any questions or thoughts, feel free to share!&lt;/p&gt;

&lt;p&gt;&lt;a href="https://seomagnifier.com/core/audio/0b75bfa6673b08e88aaab1c6effb6c38.mp3" rel="noopener noreferrer"&gt;Listen to the audio version&lt;/a&gt;&lt;/p&gt;

</description>
      <category>ai</category>
      <category>learning</category>
      <category>machinelearning</category>
    </item>
    <item>
      <title>My Experience with Aide: An AI-Powered IDE</title>
      <dc:creator>Muhammad Shoaib</dc:creator>
      <pubDate>Thu, 19 Dec 2024 06:13:44 +0000</pubDate>
      <link>https://dev.to/imuhammadshoaib/my-experience-with-aide-5d3l</link>
      <guid>https://dev.to/imuhammadshoaib/my-experience-with-aide-5d3l</guid>
      <description>&lt;p&gt;As a developer constantly on the lookout for tools that can streamline my workflow, I was excited to try out &lt;a href="https://aide.dev/" rel="noopener noreferrer"&gt;Aide&lt;/a&gt;, the open-source AI-native IDE. After using it for several weeks, I wanted to share my thoughts on its features and how it has impacted my coding experience.&lt;/p&gt;

&lt;h1&gt;
  
  
  First Impressions
&lt;/h1&gt;

&lt;p&gt;From the moment I installed Aide, I was impressed by its intuitive interface and smooth integration with VS Code. The setup process was straightforward, and I appreciated the lightweight nature of the application. It felt like I was using a familiar environment while gaining access to powerful AI capabilities.&lt;/p&gt;

&lt;h1&gt;
  
  
  Key Features That Stand Out
&lt;/h1&gt;

&lt;h3&gt;
  
  
  Proactive Assistance
&lt;/h3&gt;

&lt;p&gt;One of the standout features of Aide is its proactive agent. Rather than waiting for me to encounter errors, Aide actively suggests fixes and highlights potential issues, such as missing files in the context. This feature has significantly reduced the time I spend debugging, allowing me to focus on writing quality code.&lt;/p&gt;

&lt;h3&gt;
  
  
  Multi-File Editing
&lt;/h3&gt;

&lt;p&gt;Aide's ability to make changes across multiple files without breaking logic is a game-changer. In previous projects, I often had to worry about how changes in one file would affect others. With Aide, I can confidently implement significant updates, knowing the tool will help maintain code integrity.&lt;/p&gt;

&lt;h3&gt;
  
  
  Checkpoints for Safety
&lt;/h3&gt;

&lt;p&gt;The VS Code-native checkpoints feature is a lifesaver. It allows me to roll back to previous states easily if an AI-generated change doesn't work as expected. This safety net gives me peace of mind when experimenting with new ideas, knowing I can revert back if necessary.&lt;/p&gt;

&lt;h3&gt;
  
  
  Deep Reasoning and Context Persistence
&lt;/h3&gt;

&lt;p&gt;Aide’s deep reasoning capabilities are impressive. It breaks down complex tasks into smaller, manageable units, making it easier to tackle large projects. Additionally, the context persistence means that the AI is always aware of the changes I’m making, providing relevant suggestions that feel timely and appropriate.&lt;/p&gt;

&lt;h1&gt;
  
  
  Multiple Models for Diverse Needs
&lt;/h1&gt;

&lt;p&gt;Aide supports various AI models designed to cater to different development tasks. This flexibility allows me to choose the most appropriate model based on the specific coding challenge I’m facing. The ability to switch between models ensures that I can leverage the strengths of each one, enhancing my overall efficiency.&lt;/p&gt;

&lt;h3&gt;
  
  
  Models
&lt;/h3&gt;

&lt;p&gt;Aide supports a variety of AI models designed to cater to different development tasks. Here are the models available:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Claude Sonnet&lt;/li&gt;
&lt;li&gt;Claude Haiku&lt;/li&gt;
&lt;li&gt;GPT4o&lt;/li&gt;
&lt;li&gt;01-mini&lt;/li&gt;
&lt;li&gt;01-preview&lt;/li&gt;
&lt;li&gt;Gemini 1.5 Pro&lt;/li&gt;
&lt;li&gt;DeepSeek v2.5&lt;/li&gt;
&lt;li&gt;(New Model: You can add AI Model)&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Providers
&lt;/h3&gt;

&lt;p&gt;Aide integrates with multiple providers, allowing flexibility in choosing the best AI source for your needs:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Fireworks AI&lt;/li&gt;
&lt;li&gt;Together AI&lt;/li&gt;
&lt;li&gt;Azure OpenAI&lt;/li&gt;
&lt;li&gt;Ollama (No Configuration Required)&lt;/li&gt;
&lt;li&gt;OpenAI Compatible&lt;/li&gt;
&lt;li&gt;Open Router&lt;/li&gt;
&lt;li&gt;Gemini&lt;/li&gt;
&lt;li&gt;Open AI&lt;/li&gt;
&lt;li&gt;Anthropic&lt;/li&gt;
&lt;li&gt;CodeStory (Pre-packaged with Aide)&lt;/li&gt;
&lt;/ul&gt;

&lt;h1&gt;
  
  
  Overall Experience
&lt;/h1&gt;

&lt;p&gt;Using Aide has truly elevated my coding experience. Its combination of proactive assistance, safety features, and collaborative tools has made my workflow more efficient and enjoyable. I feel like I have a reliable partner in the IDE, helping me navigate challenges and enhancing my productivity.&lt;/p&gt;

&lt;p&gt;For any developer looking to integrate AI into their coding practices, I highly recommend giving Aide a try. It has certainly made a positive impact on my development process, and I can’t imagine going back to a traditional IDE now.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>chatgpt</category>
      <category>webdev</category>
    </item>
    <item>
      <title>Custom Validatation For Phone Number Field Elementor Form WordPress</title>
      <dc:creator>Muhammad Shoaib</dc:creator>
      <pubDate>Thu, 21 Oct 2021 09:38:15 +0000</pubDate>
      <link>https://dev.to/imuhammadshoaib/custom-validatation-for-phone-number-field-elementor-form-wordpress-2mm1</link>
      <guid>https://dev.to/imuhammadshoaib/custom-validatation-for-phone-number-field-elementor-form-wordpress-2mm1</guid>
      <description>&lt;p&gt;Elementor is fast growing WordPress builders. Elementor has it's own element called Form. Unfortunately it will not give you any validation option within the builder options. For this you have to use this custom function in you theme file called functions.php&lt;/p&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


</description>
      <category>wordpress</category>
      <category>php</category>
      <category>webdev</category>
    </item>
    <item>
      <title>Custom Validatation For Phone Number Field Contact Form 7 WordPress</title>
      <dc:creator>Muhammad Shoaib</dc:creator>
      <pubDate>Thu, 21 Oct 2021 09:09:11 +0000</pubDate>
      <link>https://dev.to/imuhammadshoaib/custom-validatation-for-phone-number-field-contact-form-7-wordpress-1m06</link>
      <guid>https://dev.to/imuhammadshoaib/custom-validatation-for-phone-number-field-contact-form-7-wordpress-1m06</guid>
      <description>&lt;p&gt;By using this snippet you can validate the Telephone field in your form. If you want to validate some specific pattren like US nummber you can use this regular expression to validate the pattren &lt;/p&gt;
&lt;pre&gt;preg_match(/^[0-9]{3}-[0-9]{3}-[0-9]{4}$/)&lt;/pre&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


</description>
      <category>wordpress</category>
      <category>php</category>
      <category>webdev</category>
    </item>
    <item>
      <title>How to hide NitroPack footer from WordPress?</title>
      <dc:creator>Muhammad Shoaib</dc:creator>
      <pubDate>Sun, 03 Oct 2021 22:03:10 +0000</pubDate>
      <link>https://dev.to/imuhammadshoaib/how-to-hide-nitropack-footer-4np</link>
      <guid>https://dev.to/imuhammadshoaib/how-to-hide-nitropack-footer-4np</guid>
      <description>&lt;p&gt;Remove NitroPack Footer is a question which is most commonly asked by people who are using free version of NitroPack.&lt;/p&gt;

&lt;p&gt;They've implemented their code in a clever method that can't be disguised using ordinary CSS. As an example. If you use CSS to alter the class of their badge to display:none, the class of that badge will be changed automatically the next time a visitor visits your website. As a result, your CSS code will no longer work on that badge.&lt;/p&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


&lt;p&gt;This is how you can remove NitroPack badge from your footer.&lt;/p&gt;

</description>
      <category>wordpress</category>
      <category>jquery</category>
      <category>snippet</category>
    </item>
    <item>
      <title>Public API 's For Your Projects</title>
      <dc:creator>Muhammad Shoaib</dc:creator>
      <pubDate>Tue, 14 Sep 2021 12:15:30 +0000</pubDate>
      <link>https://dev.to/imuhammadshoaib/public-api-s-for-your-projects-1m5e</link>
      <guid>https://dev.to/imuhammadshoaib/public-api-s-for-your-projects-1m5e</guid>
      <description>&lt;p&gt;A collective list of free APIs for use in software and web development&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href="https://openweathermap.org/api" alt="Open Weather API" rel="noopener noreferrer"&gt; Open Weather API&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Free API to gether weather information all over the world.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href="https://www.nutritionix.com/business/api" alt="Nutritionix API" rel="noopener noreferrer"&gt;Nutritionix API&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;World largest verified nutrition database.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href="https://exchangeratesapi.io/" alt="Currency Converter" rel="noopener noreferrer"&gt;Currency Converter&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Exchange rates API is a free service for current and historical foreign exchange rates by the European Central Bank.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href="https://skyscanner.github.io/slate/" alt="Skyscanner Search" rel="noopener noreferrer"&gt;Skyscanner Search&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;API to get real time information about planes travelling across the world.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href="https://rapidapi.com/apidojo/api/imdb8" alt="Movie API" rel="noopener noreferrer"&gt;Movie API&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;API to get all information about films, actors, characters, etc.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href="https://developer.spotify.com/documentation/web-api/" alt="Spotify API" rel="noopener noreferrer"&gt;Spotify API&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;View Spotify music catalog, manage user's libraries, get recomendations and more.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href="https://cloud.google.com/text-to-speech" alt="Text-To-Speech API" rel="noopener noreferrer"&gt;Text-To-Speech API&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Allow you to convert text to speech.&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;

</description>
      <category>webdev</category>
      <category>showdev</category>
    </item>
    <item>
      <title>Using Metafields in Your Shopify Theme</title>
      <dc:creator>Muhammad Shoaib</dc:creator>
      <pubDate>Thu, 05 Aug 2021 12:56:14 +0000</pubDate>
      <link>https://dev.to/imuhammadshoaib/using-metafields-in-your-shopify-theme-20gb</link>
      <guid>https://dev.to/imuhammadshoaib/using-metafields-in-your-shopify-theme-20gb</guid>
      <description>&lt;p&gt;If you've ever had to create multiple custom Liquid product templates to accommodate unique product data, you know how difficult it is to manage. I'll tell you how to do it easily :)&lt;/p&gt;

&lt;p&gt;Metafields have four components: namespace, key, value, and description (optional). Namespaces will be used to group different metafields, keys will be used to reference our information, and values will contain our unique content. We can also specify if the value is a string or integer. &lt;/p&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;
&lt;br&gt;
You can learn more about customizing metafields in our &lt;a href="https://shopify.dev/api/liquid/objects/metafield" rel="noopener noreferrer"&gt;documentation page&lt;/a&gt;. 

</description>
      <category>shopify</category>
      <category>metafield</category>
    </item>
    <item>
      <title>How to access Shopify Blog object in different pages?</title>
      <dc:creator>Muhammad Shoaib</dc:creator>
      <pubDate>Thu, 17 Jun 2021 07:48:50 +0000</pubDate>
      <link>https://dev.to/imuhammadshoaib/how-to-access-shopify-blog-object-in-different-pages-2de3</link>
      <guid>https://dev.to/imuhammadshoaib/how-to-access-shopify-blog-object-in-different-pages-2de3</guid>
      <description>&lt;p&gt;Since &lt;a href="https://www.shopify.com/?ref=muhammad-shoaib" rel="noopener noreferrer"&gt;Shopify&lt;/a&gt; lets your store have multiple blogs, you have to target the specific handle of your blog in the liquid code.&lt;/p&gt;

&lt;p&gt;Change the code from:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;code&gt;{% for article in blog.articles %}&lt;/code&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;to include the handle of your blog:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;code&gt;{% for article in blogs.news.articles %}&lt;/code&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;If you want to fetch blogs by categories, just repalce &lt;code&gt;news&lt;/code&gt; handle by your category name example below&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;code&gt;{% for article in blogs.fashion.articles %}&lt;/code&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;In above example &lt;code&gt;fashion&lt;/code&gt; is your category name.&lt;/p&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


</description>
      <category>shopify</category>
    </item>
    <item>
      <title>Prevent Repeat Purchase (WooCommerce)</title>
      <dc:creator>Muhammad Shoaib</dc:creator>
      <pubDate>Tue, 11 Aug 2020 11:32:51 +0000</pubDate>
      <link>https://dev.to/imuhammadshoaib/prevent-repeat-purchase-woocommerce-18m7</link>
      <guid>https://dev.to/imuhammadshoaib/prevent-repeat-purchase-woocommerce-18m7</guid>
      <description>&lt;p&gt;Depending on what kind of products you sell, you may want to prevent customers from purchasing a WooCommerce product more than once from your store. For some shops, you may want to disable any repeat purchases at all, or you may want to prevent repeat purchase only for a specific product.&lt;/p&gt;

&lt;h3&gt;Prevent Repeat Purchase with WooCommerce: Specific Product&lt;/h3&gt;

&lt;p&gt;The first thing we’ll need to do (and the one essential thing) is to prevent repeat purchases — this is where we’ll check that the customer has already bought the product, and ensure it can’t be purchased if so. We’ll only need the ID of the product that should not be purchased again.&lt;/p&gt;

&lt;pre&gt;//Hook into the after checkout validation action, add a callback function named 'validate_no_repeat_purchase' with a priority of 10 and pass two arguments.
add_action( 'woocommerce_after_checkout_validation', 'validate_no_repeat_purchase', 10, 2 );

//The callback function accepts the array of posted checkout data and an array of errors
function validate_no_repeat_purchase( $data, $errors ) {
    //extract the posted 'billing_phone' and use that as an argument for querying orders.
    $args = array(
        'billing_phone' =&amp;gt; (string) $data['billing_phone'],
        'date_created' =&amp;gt; '&amp;gt;' . ( time() - 60*60*24*7 )
    );
    $match = 0;

    //loop through the cart items to see if one is the product that doesn't allow repeat purchases.
    foreach( WC()-&amp;gt;cart-&amp;gt;get_cart() as $cart_item ) {
        $product_id_no_repeat_purchases = array(34855, 34854, 34841);//substitute your product id.
    if (in_array($cart_item['product_id'], $    )) {
                //use the WooCommerce helper function to query for orders with this phone number:
                $orders = wc_get_orders( $args );
                foreach ($orders as $order) {
                    foreach ( $order-&amp;gt;get_items() as $item_id =&amp;gt; $item ) {
                    $product_id = $item-&amp;gt;get_product_id();
                        if($product_id == $cart_item['product_id']) {
                            $match = 1;
                            break;
                        }
                    }
                }           
            }
        }
    //if an order with this email exists, don't allow another one.
    if ( $match == 1) {
        $errors-&amp;gt;add( 'validation', '&lt;strong&gt;Repeat orders are not allowed.&lt;/strong&gt;' );
    }
}
&lt;/pre&gt;

&lt;p&gt;And if you want to vallidate by email just change the &lt;code&gt;$args = array('customer' =&amp;gt; $data['billing_email'],);&lt;/code&gt;&lt;/p&gt;

</description>
      <category>wordpress</category>
      <category>php</category>
    </item>
    <item>
      <title>WooCommerce Filters (Order By Custom Fields)</title>
      <dc:creator>Muhammad Shoaib</dc:creator>
      <pubDate>Tue, 04 Aug 2020 15:28:43 +0000</pubDate>
      <link>https://dev.to/imuhammadshoaib/woocommerce-filters-order-by-custom-fields-1dng</link>
      <guid>https://dev.to/imuhammadshoaib/woocommerce-filters-order-by-custom-fields-1dng</guid>
      <description>&lt;p&gt;The Admin Custom Order Fields allows you to add fields to an order for details, notes, dates, and more. These fields can also be used to sort or filter orders in the order dashboard, and are geared towards streamlining and centralizing order information and notes.&lt;/p&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


&lt;p&gt;By default, these fields can only be viewed by the administrator in &lt;code&gt;WooCommerce-&amp;gt;Orders&lt;/code&gt; page.&lt;/p&gt;

</description>
      <category>wordpress</category>
      <category>php</category>
      <category>plugin</category>
    </item>
    <item>
      <title>Create Cron Jobs In Wordpress</title>
      <dc:creator>Muhammad Shoaib</dc:creator>
      <pubDate>Wed, 29 Jul 2020 22:02:44 +0000</pubDate>
      <link>https://dev.to/imuhammadshoaib/create-cron-jobs-in-wordpress-4545</link>
      <guid>https://dev.to/imuhammadshoaib/create-cron-jobs-in-wordpress-4545</guid>
      <description>&lt;p&gt;A cron job allows you to automatically set a function to run at a set time or interval. Wordpress comes with an in-built function wp_schedule_event(). Wordpress Schedule Event.&lt;/p&gt;

&lt;p&gt;The function &lt;code&gt;wp_schedule_event()&lt;/code&gt; allows you schedule a hook to run an action to schedule a function to run at a set interval&lt;/p&gt;

&lt;pre&gt; function myprefix_custom_cron_schedule( $schedules ) {
    $schedules['every_six_hours'] = array(
        'interval' =&amp;gt; 21600, // Every 6 hours
        'display'  =&amp;gt; __( 'Every 6 hours' ),
    );
    return $schedules;
}
add_filter('cron_schedules','myprefix_custom_cron_schedule' );

//Schedule an action if it's not already scheduled
if(!wp_next_scheduled('myprefix_cron_hook')) {
    wp_schedule_event( time(), 'every_six_hours', 'myprefix_cron_hook');
}

//Hook into that action that'll fire every six hours
add_action( 'myprefix_cron_hook', 'myprefix_cron_function' );
//create your function, that runs on cron
function myprefix_cron_function() {
    //your function...
}
&lt;/pre&gt;

&lt;p&gt;This script will run every six hours which isn't a big hit to the server as all it will do is check the current hours before deciding to run the script, but now we can have a script that runs every six hours. If you want to run this script at a certain time then you need to change this wp-cron to run hourly and check both the day and the time is what you want it to be.&lt;/p&gt;

</description>
      <category>wordpress</category>
      <category>php</category>
    </item>
  </channel>
</rss>
