<?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: Davina Leong</title>
    <description>The latest articles on DEV Community by Davina Leong (@davinaleong).</description>
    <link>https://dev.to/davinaleong</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%2F128919%2F189d37fa-313f-4c06-a33d-bc3bf16e68c3.png</url>
      <title>DEV Community: Davina Leong</title>
      <link>https://dev.to/davinaleong</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/davinaleong"/>
    <language>en</language>
    <item>
      <title>This Laravel Seeder Looks Like a Water Pistol — And It Seeds Like a Pro</title>
      <dc:creator>Davina Leong</dc:creator>
      <pubDate>Mon, 16 Jun 2025 04:27:00 +0000</pubDate>
      <link>https://dev.to/davinaleong/this-laravel-seeder-looks-like-a-water-pistol-and-it-seeds-like-a-pro-40cc</link>
      <guid>https://dev.to/davinaleong/this-laravel-seeder-looks-like-a-water-pistol-and-it-seeds-like-a-pro-40cc</guid>
      <description>&lt;p&gt;Sure! Here's a draft &lt;strong&gt;Dev.to article&lt;/strong&gt; based on your Laravel seeder that playfully resembles a water pistol. It’s structured for clarity, developer relatability, and searchability, while being lighthearted and educational.&lt;/p&gt;




&lt;h1&gt;
  
  
  💦 Laravel Seeder That Looks Like a Water Pistol (and It Works Too!)
&lt;/h1&gt;

&lt;p&gt;Ever written a Laravel seeder that looks like it’s &lt;em&gt;firing out data&lt;/em&gt;?&lt;br&gt;
Well… I accidentally did.&lt;/p&gt;

&lt;p&gt;And yes — it works like a charm.&lt;/p&gt;

&lt;h2&gt;
  
  
  🔍 The Use Case
&lt;/h2&gt;

&lt;p&gt;I needed to seed my database with:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;3 to 5 &lt;code&gt;SpecialContentGroup&lt;/code&gt;s&lt;/li&gt;
&lt;li&gt;Each containing 3 to 5 &lt;code&gt;SpecialContentItem&lt;/code&gt;s&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The result? A cascade of factory-generated data in a neat, fluid chain of logic — and visually, the indentation reminded me of a &lt;strong&gt;water pistol emoji&lt;/strong&gt; 💧🔫.&lt;/p&gt;

&lt;h2&gt;
  
  
  🧪 The Code
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;function&lt;/span&gt; &lt;span class="n"&gt;run&lt;/span&gt;&lt;span class="p"&gt;():&lt;/span&gt; &lt;span class="kt"&gt;void&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="c1"&gt;// Check if there are existing Special Content Groups&lt;/span&gt;
    &lt;span class="nv"&gt;$groups&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;SpecialContentGroup&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="nf"&gt;all&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;

    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$groups&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;isEmpty&lt;/span&gt;&lt;span class="p"&gt;())&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="c1"&gt;// No groups exist – create 3 to 5 groups with 3 to 5 items each&lt;/span&gt;
        &lt;span class="nv"&gt;$groupCount&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;rand&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
        &lt;span class="nv"&gt;$groups&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;SpecialContentGroup&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="nf"&gt;factory&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
            &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nb"&gt;count&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$groupCount&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
            &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;create&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
            &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nb"&gt;each&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;function&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$group&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt; &lt;span class="kt"&gt;void&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
                &lt;span class="nv"&gt;$itemsCount&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;rand&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
                &lt;span class="nc"&gt;SpecialContentItem&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="nf"&gt;factory&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
                    &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nb"&gt;count&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$itemsCount&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
                    &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="k"&gt;for&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$group&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
                    &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;create&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
            &lt;span class="p"&gt;});&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  🧠 What's Happening?
&lt;/h2&gt;

&lt;p&gt;Here’s a quick breakdown:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;SpecialContentGroup::all()&lt;/code&gt; checks if any groups exist.&lt;/li&gt;
&lt;li&gt;If none are found, it creates a random number of groups (between 3 and 5).&lt;/li&gt;
&lt;li&gt;Each group then gets a random number of related items (also between 3 and 5), thanks to &lt;code&gt;each()&lt;/code&gt; and the &lt;code&gt;-&amp;gt;for($group)&lt;/code&gt; relationship helper in Laravel factories.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  🔫 But Why the “Water Pistol”?
&lt;/h3&gt;

&lt;p&gt;Check out the indentation — it flows! 💦&lt;/p&gt;

&lt;p&gt;The nested arrow functions, when formatted with consistent tabbing and spacing, almost give off this "shooting" vibe. While that wasn’t the intention, I couldn’t unsee it after I noticed.&lt;/p&gt;

&lt;h2&gt;
  
  
  🎯 Why It’s Effective
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;✅ Makes use of Laravel's expressive factory system&lt;/li&gt;
&lt;li&gt;✅ Ensures clean, relational demo data&lt;/li&gt;
&lt;li&gt;✅ Easy to extend or tweak the counts for your use case&lt;/li&gt;
&lt;li&gt;✅ Fun and readable!&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  💡 Pro Tip
&lt;/h2&gt;

&lt;p&gt;Using the &lt;code&gt;-&amp;gt;for($group)&lt;/code&gt; method ensures that your child factory (&lt;code&gt;SpecialContentItem&lt;/code&gt;) links back to its parent (&lt;code&gt;SpecialContentGroup&lt;/code&gt;) via the defined relationship — no need to manually assign &lt;code&gt;group_id&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  📦 When Should You Use This?
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;For testing UI layouts with relational data&lt;/li&gt;
&lt;li&gt;When showcasing a dashboard that depends on group/item hierarchies&lt;/li&gt;
&lt;li&gt;In test environments where you want randomized but realistic structures&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  🗣️ Final Thoughts
&lt;/h2&gt;

&lt;p&gt;Sometimes your code ends up looking cool &lt;em&gt;and&lt;/em&gt; working great. Embrace the beauty in clean logic — even if it looks like it’s ready to squirt data all over your app. 💧💻&lt;/p&gt;




&lt;h3&gt;
  
  
  💬 What about you?
&lt;/h3&gt;

&lt;p&gt;Have you ever written code that unintentionally looked like something fun or weird?&lt;br&gt;
Drop a comment — I’d love to see your “happy accidents”!&lt;/p&gt;

</description>
      <category>laravel</category>
      <category>php</category>
      <category>webdev</category>
      <category>codeart</category>
    </item>
    <item>
      <title>7 Useful JS Fiddles</title>
      <dc:creator>Davina Leong</dc:creator>
      <pubDate>Wed, 03 Nov 2021 18:40:01 +0000</pubDate>
      <link>https://dev.to/davinaleong/7-useful-js-fiddles-1mg0</link>
      <guid>https://dev.to/davinaleong/7-useful-js-fiddles-1mg0</guid>
      <description>&lt;p&gt;Sharing some JSFiddles the rest of you may find useful. I often use JSFiddle as a playground to test out snippets of UI code before putting them into an actual project. I built all these fiddles myself, with some help from Google. Excuse the boring colour scheme; I'm not much of a designer... Anyways, hope you find these code snippets useful.&lt;/p&gt;

&lt;h1&gt;
  
  
  Custom Checkbox &amp;amp; Radio
&lt;/h1&gt;

&lt;p&gt;&lt;iframe src="https://jsfiddle.net/davinaleong/c83576a2/49//embedded/result,html,css,js//dark" width="100%" height="600"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;Custom checkboxes and radio buttons. Includes hover effects.&lt;/p&gt;

&lt;p&gt;I had a project from my day job where I had to create custom checkboxes. I already had an idea on how to do it, but needed to test the idea. I got the code to render the checkmark &lt;a href="https://www.w3schools.com/howto/howto_css_custom_checkbox.asp" rel="noopener noreferrer"&gt;here&lt;/a&gt;. I also decided to include a snippet for radio buttons in-case I needed it in the future.&lt;/p&gt;

&lt;h1&gt;
  
  
  Ribbon Label
&lt;/h1&gt;

&lt;p&gt;&lt;iframe src="https://jsfiddle.net/davinaleong/km8fd29a/27//embedded/result,html,css,js//dark" width="100%" height="600"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;Product ribbon label. The image is generated from &lt;a href="https://placeholder.com/" rel="noopener noreferrer"&gt;placeholder.com&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;My most recent project required me to style product labels as ribbons. I tried to find solutions online, but many of them were too complicated. In the end, I came up with this solution. I couldn't get pseudo elements to work for the ribbon corner. So I ended up using an inner div to achieve the result.&lt;/p&gt;

&lt;h1&gt;
  
  
  Custom File Input Placeholder
&lt;/h1&gt;

&lt;p&gt;&lt;iframe src="https://jsfiddle.net/davinaleong/th18by4d/24//embedded/result,html,css,js//dark" width="100%" height="600"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;Custom File Input Placeholder. This snippet uses &lt;a href="https://jquery.com/" rel="noopener noreferrer"&gt;jQuery&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;One of the projects I worked on recently at my day job needed needed a file input to upload the customer's profile picture. There were no input labels in the mockup. It used the &lt;code&gt;placeholder&lt;/code&gt; attribute as the input's label. The problem is the file input type doesn't render the &lt;code&gt;placeholder&lt;/code&gt; attribute. This fiddle is my solution to the problem after searching for ideas to the problem.&lt;/p&gt;

&lt;h1&gt;
  
  
  Custom Select Field
&lt;/h1&gt;

&lt;p&gt;&lt;iframe src="https://jsfiddle.net/davinaleong/pszruL8a/34//embedded/result,html,css,js//dark" width="100%" height="600"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;I often have designs that change the design of the select input arrow. After some searching, I found the code to render the arrow. Remember to make the input field's background &lt;strong&gt;transparent&lt;/strong&gt;.&lt;/p&gt;

&lt;h1&gt;
  
  
  Button with Overlapping Shadow
&lt;/h1&gt;

&lt;p&gt;&lt;iframe src="https://jsfiddle.net/davinaleong/q8me92nL/12//embedded/result,html,css,js//dark" width="100%" height="600"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;I had one project where the button had such a design. Here is the solution.&lt;/p&gt;

&lt;p&gt;To give a &lt;em&gt;transparent&lt;/em&gt; appearance, make sure the &lt;code&gt;inset&lt;/code&gt; &lt;code&gt;box-shadow&lt;/code&gt; colour is the same as the your &lt;code&gt;background colour&lt;/code&gt;.&lt;/p&gt;

&lt;h1&gt;
  
  
  Grid Gallery
&lt;/h1&gt;

&lt;p&gt;&lt;iframe src="https://jsfiddle.net/davinaleong/h7xfecu8/151//embedded/result,html,css,js//dark" width="100%" height="600"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;I had to build a grid gallery for one of my projects for my day job. Since it was company policy to support IE11, I had to find a solution that works for IE11. Here is the solution I came up with.&lt;/p&gt;

&lt;p&gt;I'm sure there's a better way to code a responsive grid, but this was what I could think of at that time.&lt;/p&gt;

&lt;h1&gt;
  
  
  Mega Menu Hover
&lt;/h1&gt;

&lt;p&gt;&lt;iframe src="https://jsfiddle.net/davinaleong/zt38hn6k/177//embedded/result,html,css,js//dark" width="100%" height="600"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;This solution uses &lt;a href="//www.jquery.com"&gt;jQuery&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;I had to build a mega menu for one of my projects. This was what I came up with.&lt;/p&gt;

</description>
      <category>tutorial</category>
      <category>programming</category>
      <category>javascript</category>
      <category>css</category>
    </item>
    <item>
      <title>Moving Personal Website from ReactJS to GatsbyJS</title>
      <dc:creator>Davina Leong</dc:creator>
      <pubDate>Wed, 10 Mar 2021 01:46:01 +0000</pubDate>
      <link>https://dev.to/davinaleong/moving-personal-website-from-reactjs-to-gatsbyjs-3hoo</link>
      <guid>https://dev.to/davinaleong/moving-personal-website-from-reactjs-to-gatsbyjs-3hoo</guid>
      <description>&lt;p&gt;&lt;a href="https://www.davina-devs.com/" rel="noopener noreferrer"&gt;Personal website&lt;/a&gt; successfully moved to &lt;a href="https://www.gatsbyjs.com/" rel="noopener noreferrer"&gt;GatsbyJS&lt;/a&gt;!&lt;/p&gt;

&lt;p&gt;The initial site was built in &lt;a href="https://reactjs.org/" rel="noopener noreferrer"&gt;ReactJS&lt;/a&gt; about a few years ago. I wanted to exercise the ReactJS skills that I picked up at my first job. Everything worked fine. But the one thing lacking about my site was routes. I couldn't point potential recruiters to the About page directly where they could find download links to the resumes.&lt;/p&gt;

&lt;p&gt;For a long time, I wanted to learn GatsbyJS, but couldn't find the time due to my day job. Finally found some time this weekend to get started. The site is deployed on &lt;a href="https://www.netlify.com/" rel="noopener noreferrer"&gt;Netlify&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;For the most part, transferring of the site was simple as GatsbyJS is built on ReactJS. The one issue I struggled with was getting &lt;a href="https://fontawesome.com/" rel="noopener noreferrer"&gt;FontAwesome Pro&lt;/a&gt; icons to work. After some Googling, I managed to get it working. Apparently, I had to use the FontAwesome's react component to render the icons.&lt;/p&gt;

&lt;p&gt;After that I ran into some issues getting the site deployed. This was when I learned how to read the deployment logs on Netlify.&lt;/p&gt;

&lt;p&gt;The first errors I encountered was some libraries were missing from the build process. I realised that I had to add an &lt;code&gt;.npmrc&lt;/code&gt; file. The next error I encountered was:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;"window" is not available during server side rendering
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;I was using &lt;code&gt;window&lt;/code&gt; in two places: for the back-to-top button and for extracting the query string. I resolved the back-to-top button by using an anchor tag over a button and modifying some styles. I then researched on alternatives to extracting query string values. I was led to this &lt;a href="https://stackoverflow.com/questions/53800162/getting-url-parameters-on-gatsbyjs" rel="noopener noreferrer"&gt;StackOverflow post&lt;/a&gt;. I went with using the &lt;code&gt;query-string&lt;/code&gt; package. The errors were resolved and the site was published successfully.&lt;/p&gt;

&lt;p&gt;Later on, I had issues with broken images. Since the projects I've published were little, I didn't want to maintain an API and a DB. I may do it in the future. So I decided to load the projects as static data on the site. After some debugging, I fixed the image urls by adding a &lt;code&gt;../&lt;/code&gt; to all images under the &lt;code&gt;/projects&lt;/code&gt; route.&lt;/p&gt;

&lt;p&gt;From reading Netlify logs to using the console to debug the image urls, I've learned a lot from deploying this GatsbyJS site. I enjoy exploring and experimenting with new technologies. Hopefully I will have a new project idea for GatsbyJS again!&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>javascript</category>
      <category>react</category>
      <category>programming</category>
    </item>
    <item>
      <title>How to deploy an Express app for free?</title>
      <dc:creator>Davina Leong</dc:creator>
      <pubDate>Mon, 20 Jan 2020 13:28:56 +0000</pubDate>
      <link>https://dev.to/davinaleong/how-to-deploy-an-express-app-for-free-367i</link>
      <guid>https://dev.to/davinaleong/how-to-deploy-an-express-app-for-free-367i</guid>
      <description>&lt;p&gt;Hi, I'm trying my hand at some simple deployment. I'm new to deployment and DevOps in general.&lt;/p&gt;

&lt;p&gt;I'm trying to deploy this &lt;a href="https://github.com/davinaleong/proj-graphql-js" rel="noopener noreferrer"&gt;repo&lt;/a&gt; on Heroku, but the app keeps crashing when I run the logs:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;heroku logs --tail
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Logs:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;2020-01-20T13:22:48.461520+00:00 heroku[web.1]: Stopping all processes with SIGTERM
2020-01-20T13:22:48.530567+00:00 heroku[web.1]: Process exited with status 143
2020-01-20T13:22:49.039979+00:00 app[web.1]: Welcom to GraphQL JS!
2020-01-20T13:23:47.885144+00:00 heroku[web.1]: State changed from starting to crashed
2020-01-20T13:23:47.785166+00:00 heroku[web.1]: Error R10 (Boot timeout) -&amp;gt; Web process failed to bind to $PORT within 60 seconds of launch
2020-01-20T13:23:47.785166+00:00 heroku[web.1]: Stopping process with SIGKILL
2020-01-20T13:23:47.868166+00:00 heroku[web.1]: Process exited with status 137
2020-01-20T13:25:22.662912+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=calm-cove-11715.herokuapp.com request_id=45fc8325-868d-4daa-b67e-177a355ecfe5 fwd="116.14.82.68" dyno= connect= service= status=503 bytes= protocol=https
2020-01-20T13:25:23.026635+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=calm-cove-11715.herokuapp.com request_id=6444cb61-eae0-4116-9b36-861ad1aef465 fwd="116.14.82.68" dyno= connect= service= status=503 bytes= protocol=https
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;What is happening, and how to I resolve this? I'm also trying to follow this &lt;a href="https://devcenter.heroku.com/articles/getting-started-with-nodejs?singlepage=true" rel="noopener noreferrer"&gt;tutorial&lt;/a&gt; on Heroku.&lt;/p&gt;

</description>
      <category>help</category>
      <category>deployment</category>
      <category>devops</category>
      <category>node</category>
    </item>
    <item>
      <title>🎨 Colors Palette Released!</title>
      <dc:creator>Davina Leong</dc:creator>
      <pubDate>Sun, 29 Dec 2019 06:27:33 +0000</pubDate>
      <link>https://dev.to/davinaleong/colors-palette-released-30dl</link>
      <guid>https://dev.to/davinaleong/colors-palette-released-30dl</guid>
      <description>&lt;h1&gt;
  
  
  About
&lt;/h1&gt;

&lt;p&gt;I released this project as a way to store hex color codes I use frequently. Feel free to use is for your own reference whenever you need the hex values of common color palettes like Bootstrap's or Material Design's palettes. 😀&lt;/p&gt;

&lt;h1&gt;
  
  
  Links
&lt;/h1&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://davinaleong.github.io/proj-color-palette/" rel="noopener noreferrer"&gt;Colors Palette&lt;/a&gt; 🎨&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/davinaleong/proj-color-palette" rel="noopener noreferrer"&gt;GitHub&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>html</category>
      <category>css</category>
      <category>javascript</category>
      <category>jquery</category>
    </item>
    <item>
      <title>Material Colors Palette</title>
      <dc:creator>Davina Leong</dc:creator>
      <pubDate>Sun, 29 Dec 2019 03:10:35 +0000</pubDate>
      <link>https://dev.to/davinaleong/material-colors-palette-383</link>
      <guid>https://dev.to/davinaleong/material-colors-palette-383</guid>
      <description>&lt;h1&gt;
  
  
  About
&lt;/h1&gt;

&lt;p&gt;Just sharing a resource I use on a regular basis. Here is a list of all colors from the Material's Design palette. Click on the color &lt;strong&gt;tabs&lt;/strong&gt; to reveal the hex values of the tints.&lt;/p&gt;

&lt;h1&gt;
  
  
  Links
&lt;/h1&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://www.materialpalette.com/colors"&gt;Material Colors Palette&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>materialcolors</category>
    </item>
    <item>
      <title>Pokemon-Teams App Template Released!</title>
      <dc:creator>Davina Leong</dc:creator>
      <pubDate>Sun, 29 Dec 2019 02:58:46 +0000</pubDate>
      <link>https://dev.to/davinaleong/released-pokemon-teams-app-template-lag</link>
      <guid>https://dev.to/davinaleong/released-pokemon-teams-app-template-lag</guid>
      <description>&lt;h1&gt;
  
  
  About
&lt;/h1&gt;

&lt;p&gt;This template is the first part of a &lt;em&gt;3-part project&lt;/em&gt;. The second part is to build a React App, and part-3 is a CMS to update the Pokemon teams. I've always enjoyed playing the main Pokemon games like Pokemon Sun &amp;amp; Moon and Pokemon Sword &amp;amp; Shield. I've been playing them since Pokemon Red &amp;amp; Blue. I can get quite fanatical about battle strategies. Currently I store my own teams on Google Docs. Now finally confident enough in my development skills, I've decided to build an app to house all these teams I made.&lt;/p&gt;

&lt;h1&gt;
  
  
  Tech Stack
&lt;/h1&gt;

&lt;p&gt;This is a pure &lt;code&gt;CSS&lt;/code&gt; template built in &lt;code&gt;SASS&lt;/code&gt;, using the &lt;a href="https://www.materialpalette.com/colors"&gt;Materials Colors&lt;/a&gt; palette. I also took advantage of the opportunity to also explore &lt;strong&gt;CSS Grid&lt;/strong&gt;. For example, CSS Grid is used to layout the sidebar and main content. &lt;strong&gt;Flexbox&lt;/strong&gt; is used to layout the team-cards.&lt;/p&gt;

&lt;h1&gt;
  
  
  Links
&lt;/h1&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://davinaleong.github.io/proj-pokemon-teams-template/"&gt;Demo&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/davinaleong/proj-pokemon-teams-template"&gt;Repo&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.materialpalette.com/colors"&gt;Materials Colors Palette&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>css</category>
      <category>sass</category>
      <category>cssgrid</category>
      <category>flexbox</category>
    </item>
    <item>
      <title>Released my first Bootstrap 4 template!</title>
      <dc:creator>Davina Leong</dc:creator>
      <pubDate>Fri, 08 Mar 2019 11:34:14 +0000</pubDate>
      <link>https://dev.to/davinaleong/released-my-first-bootstrap-4-template-2b00</link>
      <guid>https://dev.to/davinaleong/released-my-first-bootstrap-4-template-2b00</guid>
      <description>&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fl9gt60eh7qryzklm22id.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fl9gt60eh7qryzklm22id.png" alt="template screenshot" width="800" height="404"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Links
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://davinaleong.github.io/proj-comphanny-template/" rel="noopener noreferrer"&gt;Demo&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/davinaleong/proj-comphanny-template" rel="noopener noreferrer"&gt;Repo&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Teck Stack
&lt;/h2&gt;

&lt;p&gt;This template is built in Bootstrap 4 with Font Awesome 5 for icons.&lt;br&gt;
I also decided to use &lt;code&gt;SASS&lt;/code&gt; to code up the styles to make it easier to assign colours, and font families through the use of variables, functions and mixins.&lt;/p&gt;

&lt;h2&gt;
  
  
  Purpose
&lt;/h2&gt;

&lt;p&gt;This template is actually the first half of a 2-part demo project I built last week. I was scheduled to do a presentation on CraftCMS earlier this week. This is the template which the Craft side would use to display entry records.&lt;/p&gt;

&lt;h2&gt;
  
  
  Idea
&lt;/h2&gt;

&lt;p&gt;I came up with the idea of creating a fake company. This company specializes in developing custom web and mobile applications for clients. The audience of the talk was a local PHP community. Hence, I came up with the company's name &lt;em&gt;"Comphanny"&lt;/em&gt; which is a play on the words "company", "php", and  "ph" being pronunced as "f" in "elephant" which is the animal typically associated with PHP.&lt;/p&gt;

&lt;h2&gt;
  
  
  Reflection
&lt;/h2&gt;

&lt;p&gt;I initally wanted to build this template from scratch, to practise my &lt;code&gt;CSS&lt;/code&gt; &amp;amp; web design skills, as well as explore Flexbox and CSS grid. But due to time constraints from my day job, and still having the Craft part of the project to build, I felt it was too ambitious. So I decided to go building off Bootstrap since it was what I was familiar with.&lt;/p&gt;

</description>
      <category>showdev</category>
      <category>bootstrap</category>
      <category>sass</category>
      <category>template</category>
    </item>
    <item>
      <title>How to make backgrounds like the default WhatsApp wallpaper?</title>
      <dc:creator>Davina Leong</dc:creator>
      <pubDate>Thu, 07 Mar 2019 05:50:58 +0000</pubDate>
      <link>https://dev.to/davinaleong/how-to-make-backgrounds-like-the-default-whatsapp-wallpaper-24pc</link>
      <guid>https://dev.to/davinaleong/how-to-make-backgrounds-like-the-default-whatsapp-wallpaper-24pc</guid>
      <description>&lt;p&gt;Hi designers,&lt;/p&gt;

&lt;p&gt;What is the technique to create "fine-print" backgrounds like the default WhatsApp wallpaper? I also need it to be responsive and the shapes to be distinguishable at different resolutions. I presume this is achieved through vector graphics like &lt;code&gt;.svg&lt;/code&gt;?&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fb9qk3w41sqf1l0ccujfh.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fb9qk3w41sqf1l0ccujfh.png" alt="WhatsApp background" width="760" height="1396"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Also, how to I make "code-text" backgrounds? Can't find a reference image for this so I'll try my best to explain what I'm trying to achieve. I want a background that's basically a chuck of code with muted colours. While the background-text is distinguishable, it shouldn't clash with the foreground content.&lt;/p&gt;

&lt;p&gt;Any tips and tricks on techniques on how to achieve this?&lt;br&gt;
Or at least links to such resources?&lt;/p&gt;

&lt;p&gt;I'm trying to create backgrounds like this for a website I'm making. The theme of the website is centred around web development and programming.&lt;/p&gt;

&lt;p&gt;Thanks.&lt;/p&gt;

</description>
      <category>help</category>
      <category>discuss</category>
      <category>design</category>
      <category>webdev</category>
    </item>
    <item>
      <title>Moving Away from AMPPS for Local Dev</title>
      <dc:creator>Davina Leong</dc:creator>
      <pubDate>Sun, 17 Feb 2019 04:53:51 +0000</pubDate>
      <link>https://dev.to/davinaleong/moving-away-from-ampps-for-local-dev-1o4j</link>
      <guid>https://dev.to/davinaleong/moving-away-from-ampps-for-local-dev-1o4j</guid>
      <description>&lt;p&gt;Ever since I started web development, I've been using &lt;a href="http://www.wampserver.com/en/" rel="noopener noreferrer"&gt;WAMP&lt;/a&gt; and later on &lt;a href="https://www.ampps.com/" rel="noopener noreferrer"&gt;AMPPS&lt;/a&gt;, which is just WAMP/&lt;a href="https://www.mamp.info/en/" rel="noopener noreferrer"&gt;MAMP&lt;/a&gt; with a better UI. But I feel I've been taking environment-setup for granted, and want to move away from that.&lt;/p&gt;

&lt;p&gt;Since I've been introduced to &lt;a href="https://www.docker.com/" rel="noopener noreferrer"&gt;Docker&lt;/a&gt; at work, I've been wanting to learn how to setup my own local development environment. At, work, the tech director would be the one to do the setup process, and I would just run it. But I was curious in wanting seeing how the different pieces come together--to through the process so I better understand the deployment side of web development. This aslo helps me be more effective as troubleshooting problems during the setup process.&lt;/p&gt;

&lt;p&gt;I initally tried doing on my existing Windows machine. So I went and got a MBP, since Mac comes preinstalled with PHP and MySQL. Also it being based off Unix makes it simpler to run &lt;code&gt;bash&lt;/code&gt; commands and scripts too!&lt;/p&gt;

&lt;p&gt;Instead of diving straight into Docker, I decided to start simple and see if I could just get a local dev server running. After 3 days of trial and error and much Googling, finally managed to get an existing project running on Valet.&lt;/p&gt;

&lt;p&gt;Through the whole process, I learned how to use &lt;a href="https://brew.sh/" rel="noopener noreferrer"&gt;Homebrew&lt;/a&gt; and &lt;a href="https://laravel.com/docs/5.7/valet" rel="noopener noreferrer"&gt;Valet&lt;/a&gt; The biggest challenge I faced was trying to get Sequel Pro connected to localhost MySQL.&lt;/p&gt;

&lt;p&gt;Next setup is figuring out how to write the Docker scripts for a typical LEMP setup. Then figure out how to setup local dev environments specifically for &lt;a href="https://laravel.com/" rel="noopener noreferrer"&gt;Laravel&lt;/a&gt; and &lt;a href="https://craftcms.com/" rel="noopener noreferrer"&gt;Craft&lt;/a&gt;. I know there's &lt;a href="https://laradock.io/" rel="noopener noreferrer"&gt;LaraDock&lt;/a&gt; for Laravel... would that also work for Craft (or CraftCMS)?&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>learning</category>
      <category>lemp</category>
      <category>ampps</category>
    </item>
    <item>
      <title>Resolutions to setup issues with Craft on AMPPS</title>
      <dc:creator>Davina Leong</dc:creator>
      <pubDate>Fri, 08 Feb 2019 06:53:40 +0000</pubDate>
      <link>https://dev.to/davinaleong/resolutions-to-setup-issues-with-craft-on-ampps-2of1</link>
      <guid>https://dev.to/davinaleong/resolutions-to-setup-issues-with-craft-on-ampps-2of1</guid>
      <description>&lt;p&gt;This is a followup to my post on &lt;strong&gt;Introduction to Craft&lt;/strong&gt;.&lt;br&gt;
&lt;/p&gt;
&lt;div class="ltag__link"&gt;
  &lt;a href="/davinaleong" class="ltag__link__link"&gt;
    &lt;div class="ltag__link__pic"&gt;
      &lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F128919%2F189d37fa-313f-4c06-a33d-bc3bf16e68c3.png" alt="davinaleong"&gt;
    &lt;/div&gt;
  &lt;/a&gt;
  &lt;a href="https://dev.to/davinaleong/introduction-to-craftcms-1n9a" class="ltag__link__link"&gt;
    &lt;div class="ltag__link__content"&gt;
      &lt;h2&gt;Introduction to Craft&lt;/h2&gt;
      &lt;h3&gt;Davina Leong ・ Jan 18 '19&lt;/h3&gt;
      &lt;div class="ltag__link__taglist"&gt;
        &lt;span class="ltag__link__tag"&gt;#php&lt;/span&gt;
        &lt;span class="ltag__link__tag"&gt;#craft&lt;/span&gt;
        &lt;span class="ltag__link__tag"&gt;#learning&lt;/span&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/a&gt;
&lt;/div&gt;


&lt;p&gt;Note that this &lt;em&gt;isn't&lt;/em&gt; a conclusive list. It is simple me listing down the issues I faced and how I resolved them.&lt;/p&gt;

&lt;h1&gt;
  
  
  A: Getting Craft working on AMPPS on Mac
&lt;/h1&gt;

&lt;ul&gt;
&lt;li&gt;Create a &lt;code&gt;/developer&lt;/code&gt; folder in your home directory.&lt;/li&gt;
&lt;li&gt;Create a folder in the &lt;code&gt;/developer&lt;/code&gt; for your Craft project; e.g. (&lt;code&gt;/my-craft-project&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;Install Craft in that folder either &lt;a href="https://docs.craftcms.com/v3/installation.html" rel="noopener noreferrer"&gt;manually&lt;/a&gt;, or via &lt;a href="https://docs.craftcms.com/v3/installation.html" rel="noopener noreferrer"&gt;Composer&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;Open up your &lt;strong&gt;terminal&lt;/strong&gt; and &lt;code&gt;cd&lt;/code&gt; to the &lt;code&gt;/web&lt;/code&gt; folder of your Craft project and type:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;pwd&lt;/span&gt; | pbcopy
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This command copies the path of the current directory into your clipboard. &lt;em&gt;Note: Don't be alarmed if you don't get any success messages.&lt;/em&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Navigate to your &lt;strong&gt;AMPPS' Alias Manager&lt;/strong&gt; and click on &lt;strong&gt;Add New&lt;/strong&gt;
&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F57rwm49mhvca62aw91vy.png" alt="AMPPS alias manager" width="800" height="454"&gt;
&lt;/li&gt;
&lt;li&gt;Paste the path you copied in Step (4) into the &lt;strong&gt;Path&lt;/strong&gt; field. The form should look something like this when filled up:
&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fs724orugxj1k1r157asb.png" alt="AMPPS add new alias" width="800" height="140"&gt;
Click on &lt;strong&gt;Create Alias&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;To test, make sure that AMPPS is running, then navigate to &lt;code&gt;http://localhost/my-craft-project&lt;/code&gt;. You should either see the Craft welcome page, or your Craft's homepage if you've set it.&lt;/li&gt;
&lt;/ul&gt;




&lt;h1&gt;
  
  
  B: Plugin Store fails to Load
&lt;/h1&gt;

&lt;ul&gt;
&lt;li&gt;Download &lt;code&gt;[cacert.pem](https://curl.haxx.se/ca/cacert.pem)&lt;/code&gt; and move it to the &lt;code&gt;/developer&lt;/code&gt; folder in (A).
-. In the AMPPS console, click on the PHP's &lt;strong&gt;gear&lt;/strong&gt; icon. Then click on the &lt;strong&gt;spanner&lt;/strong&gt; icon beside it to launch the &lt;code&gt;php.ini&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Search for &lt;code&gt;curl.info&lt;/code&gt;. You'll see something that looks like this:
&lt;code&gt;:curl.info =&lt;/code&gt;
Replace that line with this:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight ini"&gt;&lt;code&gt;&lt;span class="py"&gt;curl.cainfo&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"/Users/&amp;lt;username&amp;gt;/developer/cacert.pem"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Remember to change &lt;code&gt;&amp;lt;username&amp;gt;&lt;/code&gt; to the name of your &lt;strong&gt;Home&lt;/strong&gt; directory.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Restart your Apache server and reload your webpage&lt;/li&gt;
&lt;/ul&gt;




</description>
      <category>php</category>
      <category>craft</category>
      <category>troubleshoot</category>
    </item>
    <item>
      <title>Introduction to Craft</title>
      <dc:creator>Davina Leong</dc:creator>
      <pubDate>Fri, 18 Jan 2019 10:19:34 +0000</pubDate>
      <link>https://dev.to/davinaleong/introduction-to-craftcms-1n9a</link>
      <guid>https://dev.to/davinaleong/introduction-to-craftcms-1n9a</guid>
      <description>&lt;p&gt;I first chanced upon &lt;a href="https://craftcms.com/" rel="noopener noreferrer"&gt;Craft&lt;/a&gt; at work while working on a small side project. This is the &lt;a href="https://craftquest.io/courses/craft-cms-3-tutorials" rel="noopener noreferrer"&gt;tutorial&lt;/a&gt; I followed.&lt;/p&gt;

&lt;h1&gt;
  
  
  Local Env Setup
&lt;/h1&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://www.ampps.com/" rel="noopener noreferrer"&gt;AMPPS&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Apache&lt;/li&gt;
&lt;li&gt;PHP 7.1&lt;/li&gt;
&lt;li&gt;MySQL&lt;/li&gt;
&lt;li&gt;Craft 3&lt;/li&gt;
&lt;/ul&gt;

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

&lt;p&gt;I must say, I'm quite impressed with Craft's ease-of-use. I did initially run into problems during the setup process, especially with regards to the plugin store. But this was due more to my lack of experience with &lt;a href="https://www.ampps.com/" rel="noopener noreferrer"&gt;AMPPS&lt;/a&gt; (akin to MAMP, XAMPP, etc) rather than Craft itself. &lt;em&gt;(I'll write a separate post on the issues I faced and my resolutions to them.)&lt;/em&gt; But once I got it up and running, Craft is a joy to use!&lt;/p&gt;

&lt;h1&gt;
  
  
  Walkthrough
&lt;/h1&gt;

&lt;p&gt;After setup, you will be brought to the admin dashboard.&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fir16jb2qk9q5z55la4gn.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fir16jb2qk9q5z55la4gn.png" alt="admin dashboard" width="800" height="507"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Most of your development work will be done here on the admin panel. Coding is only needed when you create templates to display your content on. Even so, template-creation is a breeze with &lt;a href="https://twig.symfony.com/" rel="noopener noreferrer"&gt;Twig&lt;/a&gt;. In fact, I hadn't touch any PHP code (apart from the configs) while exploring Craft. Here are some sample code:&lt;/p&gt;

&lt;p&gt;Main layout, &lt;code&gt;/layouts/main.twig&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight twig"&gt;&lt;code&gt;&lt;span class="cp"&gt;&amp;lt;!doctype html&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;html&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;head&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;title&amp;gt;&lt;/span&gt;Website&lt;span class="nt"&gt;&amp;lt;/title&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;body&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;h1&amp;gt;&lt;/span&gt;Website&lt;span class="nt"&gt;&amp;lt;/h1&amp;gt;&lt;/span&gt;

  &lt;span class="cp"&gt;{%&lt;/span&gt; &lt;span class="k"&gt;block&lt;/span&gt; &lt;span class="nv"&gt;content&lt;/span&gt; &lt;span class="cp"&gt;%}&lt;/span&gt;
  &lt;span class="cp"&gt;{%&lt;/span&gt; &lt;span class="k"&gt;endblock&lt;/span&gt; &lt;span class="cp"&gt;%}&lt;/span&gt;

  &lt;span class="nt"&gt;&amp;lt;footer&amp;gt;&lt;/span&gt;Website, 2019&lt;span class="nt"&gt;&amp;lt;/footer&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;About page, &lt;code&gt;/about/index.twig&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight twig"&gt;&lt;code&gt;&lt;span class="cp"&gt;{%&lt;/span&gt; &lt;span class="k"&gt;extends&lt;/span&gt; &lt;span class="s2"&gt;"_layouts/main"&lt;/span&gt; &lt;span class="cp"&gt;%}&lt;/span&gt;

&lt;span class="cp"&gt;{%&lt;/span&gt; &lt;span class="k"&gt;block&lt;/span&gt; &lt;span class="nv"&gt;content&lt;/span&gt; &lt;span class="cp"&gt;%}&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;h2&amp;gt;&lt;/span&gt;About&lt;span class="nt"&gt;&amp;lt;/h2&amp;gt;&lt;/span&gt;

&lt;span class="nt"&gt;&amp;lt;p&amp;gt;&lt;/span&gt;Lorem ipsum&lt;span class="nt"&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
&lt;span class="cp"&gt;{%&lt;/span&gt; &lt;span class="k"&gt;endblock&lt;/span&gt; &lt;span class="cp"&gt;%}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  The Dashboard
&lt;/h2&gt;

&lt;p&gt;Anyways, back to the admin dashboard. A few things you should note immediately (besides the obvious widgets): that yellow-dashed line at the top of the sidebar, your current license (more on that later) as well as the "C" and "&amp;lt;" buttons towards the lower-right corner.&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fir16jb2qk9q5z55la4gn.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fir16jb2qk9q5z55la4gn.png" alt="admin dashboard" width="800" height="507"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  DevMode
&lt;/h2&gt;

&lt;p&gt;The yellow-dashed line indicates that &lt;code&gt;devMode&lt;/code&gt; is currently set to &lt;code&gt;true&lt;/code&gt; in Craft. To remove the yellow-dashed line, open &lt;code&gt;/config/general.php&lt;/code&gt; and set &lt;code&gt;devMode&lt;/code&gt; under &lt;code&gt;dev&lt;/code&gt; to &lt;code&gt;false&lt;/code&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="c1"&gt;// Dev environment settings&lt;/span&gt;
&lt;span class="s1"&gt;'dev'&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
    &lt;span class="c1"&gt;// Base site URL&lt;/span&gt;
    &lt;span class="s1"&gt;'siteUrl'&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="kc"&gt;null&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;

    &lt;span class="c1"&gt;// Dev Mode (see https://craftcms.com/support/dev-mode)&lt;/span&gt;
    &lt;span class="s1"&gt;'devMode'&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="c1"&gt;// &amp;lt;= set this to false&lt;/span&gt;
&lt;span class="p"&gt;],&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In &lt;code&gt;devMode&lt;/code&gt;, Craft gives you a stack trace when there are errors in your code. While this is useful for debugging, it obviously poses a security hazard.&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6vbuhcgk1gxdv86plzp4.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6vbuhcgk1gxdv86plzp4.png" alt="devMode = true" width="800" height="454"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;With &lt;code&gt;devMode&lt;/code&gt; set to &lt;code&gt;false&lt;/code&gt;, Craft just throws an HTTP error.&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F7xndleamplvky5823alm.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F7xndleamplvky5823alm.png" alt="devMode = false" width="800" height="454"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  Yii Toolbar
&lt;/h2&gt;

&lt;p&gt;The "C" and "&amp;lt;" buttons in the lower-left corner of the page is actually the collapsed Yii toolbar.&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6y67sf7p19b77gc01d8u.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6y67sf7p19b77gc01d8u.png" alt="yii toolbar" width="800" height="16"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Expanded&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fcww52wvhd4r6d2hcmq34.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fcww52wvhd4r6d2hcmq34.png" alt="yii toolbar - expanded" width="800" height="336"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Already you can see various information about the page, like its status, memory usage, etc. You can expand it to see more details too! I haven't used it yet though, so I can't comment much on it. But at a glance, seems like this toolbar could potentially replace Chrome's DevTools.&lt;/p&gt;
&lt;h2&gt;
  
  
  Licenses
&lt;/h2&gt;

&lt;p&gt;Craft has 3 licenses: Solo, Pro and Enterprise. The main difference I've seen between the Solo and Pro licenses so far is the ability to have multiple admin accounts in Pro. As for the Enterprise license, I presume it's for customised solutions.&lt;/p&gt;
&lt;h2&gt;
  
  
  Content Creation
&lt;/h2&gt;

&lt;p&gt;As I've said before, most of your content creation will be done on the admin panel itself. Below is a screenshot of the field-creation form.&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fuj5gnqsfy31xeg48vf9q.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fuj5gnqsfy31xeg48vf9q.png" alt="field-creation form" width="800" height="454"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Craft's content-creation workflow is (generally) as such: &lt;strong&gt;Sections &amp;gt; Fields &amp;gt; Entries&lt;/strong&gt;. Sections is the types or kinds of content the website will have like news, posts, etc. Fields are where you create, literally, the fields that will be used to create content of a section to be displayed, like a news' title and body. Entries are the actual records of the content created from these fields.&lt;/p&gt;

&lt;p&gt;(to my understanding) So, you have a News section. Then you create the fields to allow users to input data for the news' title and body content, and &lt;em&gt;that&lt;/em&gt; record of a new's title and body is a news entry. This is where you might also see the separation of roles too! That feature is available via the Pro license. &lt;a href="https://docs.craftcms.com/v3/sections-and-entries.html" rel="noopener noreferrer"&gt;More reading&lt;/a&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fgifb4t82nk81wniti1bl.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fgifb4t82nk81wniti1bl.png" alt="arranging fields for entry creation" width="800" height="454"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The thing is, fields in Craft is separated from sections. This means you are able to reuse fields in other sections. Say now you have a Blogs section. Well, blogs usually have posts and comments. Each blogpost will also (at least) have a title and body content. In this case, you can reuse the fields used for the news' title and body content-creation for blog content-creation. And then create fields specific to blog, like a field for a cover-image.&lt;/p&gt;
&lt;h2&gt;
  
  
  The Matrix Field
&lt;/h2&gt;

&lt;p&gt;I'm just going to specifically point out this really cool feature in Craft: the matrix field.&lt;/p&gt;

&lt;p&gt;Creating the matrix field&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fh4sz2u2ztylf18ydnlfa.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fh4sz2u2ztylf18ydnlfa.png" alt="matrix field - creation" width="800" height="454"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Using the matrix field&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fan25y2k4es2r2u170lyf.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fan25y2k4es2r2u170lyf.png" alt="matrix field - usage" width="800" height="454"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Matrix field content&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0xzbk4iseu0hqlowxbyk.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0xzbk4iseu0hqlowxbyk.png" alt="matrix field - content" width="800" height="454"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Everything below the "Recipe Snapshot" is generate by the matrix field. This allows you to arrange and sort your content however you like. Better yet, you only have to define the template of each content block once, and Craft will know to use template for that content. In the screenshot above, the template for the "tips" div for example, was only defined once!&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight twig"&gt;&lt;code&gt;&lt;span class="c"&gt;{# Recipe Tip end #}&lt;/span&gt;
  &lt;span class="cp"&gt;{%&lt;/span&gt; &lt;span class="nv"&gt;case&lt;/span&gt; &lt;span class="s1"&gt;'recipeTip'&lt;/span&gt; &lt;span class="cp"&gt;%}&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"panel tip"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
        &lt;span class="nt"&gt;&amp;lt;p&amp;gt;&lt;/span&gt;&lt;span class="cp"&gt;{{&lt;/span&gt; &lt;span class="nv"&gt;block.tipContent&lt;/span&gt; &lt;span class="cp"&gt;}}&lt;/span&gt;&lt;span class="nt"&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
&lt;span class="c"&gt;{# Recipe Tip end #}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Pretty cool huh?!&lt;/p&gt;

&lt;p&gt;Well that wraps up my introduction to Craft!&lt;/p&gt;

&lt;h1&gt;
  
  
  Links
&lt;/h1&gt;

&lt;p&gt;&lt;strong&gt;Related&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://craftcms.com/" rel="noopener noreferrer"&gt;Craft&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://twig.symfony.com/" rel="noopener noreferrer"&gt;Twig&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://craftquest.io/courses/craft-cms-3-tutorials" rel="noopener noreferrer"&gt;Tutorial: Up and Running with Craft&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.ampps.com/" rel="noopener noreferrer"&gt;AMPPS&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Others&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://www.yiiframework.com/" rel="noopener noreferrer"&gt;Yii&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://craftquest.io/" rel="noopener noreferrer"&gt;CraftQuest (Craft tutorials)&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://craftquest.io/courses/the-craft-mindset" rel="noopener noreferrer"&gt;Tutorial: The Craft Mindset&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>php</category>
      <category>craft</category>
      <category>learning</category>
    </item>
  </channel>
</rss>
