<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Hein Zeya on Medium]]></title>
        <description><![CDATA[Stories by Hein Zeya on Medium]]></description>
        <link>https://medium.com/@heinzeya?source=rss-2566ca14bbaf------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*DT9nHllf_QwLzSJvoRPJIw.png</url>
            <title>Stories by Hein Zeya on Medium</title>
            <link>https://medium.com/@heinzeya?source=rss-2566ca14bbaf------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 29 Nov 2026 10:51:14 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@heinzeya/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Understanding Elixir Mix Tasks]]></title>
            <link>https://medium.com/@heinzeya/understanding-elixir-mix-tasks-4953a4c50515?source=rss-2566ca14bbaf------2</link>
            <guid isPermaLink="false">https://medium.com/p/4953a4c50515</guid>
            <category><![CDATA[elixir]]></category>
            <dc:creator><![CDATA[Hein Zeya]]></dc:creator>
            <pubDate>Tue, 07 Apr 2026 00:42:42 GMT</pubDate>
            <atom:updated>2026-04-07T00:42:42.373Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4bt2oc2mpU1RvQeq3COgCA.jpeg" /></figure><p>When people first learn Elixir, they often focus on OTP, GenServers, or Phoenix.</p><p>But there’s a powerful and underrated tool sitting quietly in every project:</p><p>👉 <strong>Mix Tasks</strong></p><p>If you’ve used:</p><ul><li>npm scripts in Node.js</li><li>go run or CLI tools in Go</li></ul><p>Then Mix tasks are Elixir’s way of doing <strong>CLI automation — but cleaner and more structured</strong>.</p><h3>🚀 What is a Mix Task?</h3><p>A <strong>Mix task</strong> is simply a command you can run from your terminal:</p><pre>mix something</pre><p>Under the hood, it’s just an Elixir module that implements a run/1 function.</p><h3>🧱 Your First Mix Task</h3><p>Let’s start simple.</p><p>Create this file:</p><p>lib/mix/tasks/hello.ex</p><pre>defmodule Mix.Tasks.Hello do<br>  use Mix.Task<br><br>  @shortdoc &quot;Prints a friendly hello&quot;<br><br>  def run(_args) do<br>    IO.puts(&quot;Hello from Mix 👋&quot;)<br>  end<br>end</pre><p>Now run:</p><pre>mix hello</pre><p>Output:</p><pre>Hello from Mix 👋</pre><h3>🧠 Adding Arguments (Make It Useful)</h3><p>Let’s make it dynamic.</p><pre>defmodule Mix.Tasks.Greet do<br>  use Mix.Task<br><br>  @shortdoc &quot;Greets a user&quot;<br><br>  def run(args) do<br>    name = List.first(args) || &quot;Guest&quot;<br>    IO.puts(&quot;Hello, #{name}!&quot;)<br>  end<br>end</pre><p>Run:</p><pre>mix greet Hein</pre><p>Output:</p><pre>Hello, Hein!</pre><h3>🧪 Real-World Example: Seeding Data</h3><p>Let’s say you want to seed your database.</p><pre>defmodule Mix.Tasks.Seed.Users do<br>  use Mix.Task<br><br>  @shortdoc &quot;Seeds users into database&quot;<br><br>  def run(_args) do<br>    Mix.Task.run(&quot;app.start&quot;)<br><br>    users = [<br>      %{name: &quot;Alice&quot;},<br>      %{name: &quot;Bob&quot;}<br>    ]<br><br>    Enum.each(users, fn user -&gt;<br>      MyApp.Repo.insert!(user)<br>    end)<br><br>    IO.puts(&quot;Users seeded ✅&quot;)<br>  end<br>end</pre><p>Run:</p><pre>mix seed.users</pre><h3>⚙️ How It Compares to Other Ecosystems</h3><p>If you come from other stacks:</p><ul><li>In Node.js → package.json scripts</li><li>In Go → custom CLI tools</li><li>In Python → management commands</li></ul><p>Mix tasks feel like a <strong>built-in, structured CLI framework</strong>.</p><h3>💡 When Should You Use Mix Tasks?</h3><p>Use Mix tasks when you need to:</p><ul><li>Seed or migrate data</li><li>Run batch jobs</li><li>Fix production data issues</li><li>Trigger internal workflows</li><li>Build internal developer tools</li><li>Automate deployments</li></ul><p>In real systems, they become your <strong>operational toolkit</strong>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4953a4c50515" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Entry Points in Go vs Node.js vs Elixir Explained]]></title>
            <link>https://medium.com/@heinzeya/entry-points-in-go-vs-node-js-vs-elixir-explained-88a324f29273?source=rss-2566ca14bbaf------2</link>
            <guid isPermaLink="false">https://medium.com/p/88a324f29273</guid>
            <category><![CDATA[backend-engineering]]></category>
            <category><![CDATA[golang]]></category>
            <category><![CDATA[elixir]]></category>
            <category><![CDATA[nodejs]]></category>
            <dc:creator><![CDATA[Hein Zeya]]></dc:creator>
            <pubDate>Mon, 06 Apr 2026 17:23:44 GMT</pubDate>
            <atom:updated>2026-04-06T17:23:44.272Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4xwO3hvi1FngWzqmRDIFVg.png" /></figure><p>Every program needs a starting point.</p><p>In most languages, it’s obvious:</p><ul><li>Go → main()</li><li>Node.js → the file you run</li><li>Elixir → …something else entirely</li></ul><p>If you’re coming from Go or Node.js, Elixir can feel confusing at first.</p><p>There’s no clear main() function.<br> No obvious “start here” file.</p><p>So where does your program actually begin?</p><p>Let’s break it down.</p><h3>What Is an Entry Point?</h3><p>An <strong>entry point</strong> is:</p><blockquote><em>The place where execution begins when your program starts.</em></blockquote><p>Simple idea — but different languages implement it very differently.</p><h3>Go: Everything Starts from main()</h3><p>Go keeps things explicit and predictable.</p><pre>package main<br><br>import &quot;fmt&quot;<br><br>func main() {<br>    fmt.Println(&quot;Hello from Go&quot;)<br>}</pre><p>Run it:</p><pre>go run main.go</pre><h3>What happens behind the scenes?</h3><ol><li>Go compiles your code into a binary</li><li>The OS starts a process</li><li>Execution begins at main()</li><li>Your program runs line-by-line</li></ol><h3>Node.js: The File Is the Entry Point</h3><p>Node.js feels even simpler.</p><pre>console.log(&quot;Hello from Node.js&quot;);</pre><p>Run it:</p><pre>node index.js</pre><h3>What actually happens?</h3><ol><li>Node starts the V8 engine</li><li>Loads your file</li><li>Executes it top-to-bottom</li><li>Starts the event loop</li></ol><h3>Elixir: No main(), No Single Entry</h3><p>This is where things change.</p><p>Elixir does not revolve around a single function or file.</p><h3>Case 1: Script Mode (Looks Familiar)</h3><p>You <em>can</em> run Elixir like a script:</p><pre>IO.puts(&quot;Hello from Elixir&quot;)</pre><p>Run it:</p><pre>elixir hello.exs</pre><p>This behaves like Node.js — simple and linear.</p><h3>Case 2: Real Elixir Applications (OTP)</h3><p>In real-world Elixir, you don’t run scripts.</p><p>You start an <strong>application</strong>.</p><p>Example: Minimal OTP Application</p><pre>defmodule MyApp.Application do<br>  use Application<br><br>  def start(_type, _args) do<br>    children = [<br>      {Task, fn -&gt; IO.puts(&quot;Worker started&quot;) end}<br>    ]<br><br>    Supervisor.start_link(children, strategy: :one_for_one)<br>  end<br>end</pre><p>Run:</p><pre>mix run --no-halt</pre><h3>What actually happens?</h3><ol><li>The <strong>BEAM VM</strong> starts</li><li>Your application is loaded</li><li>start/2 is called</li><li>A <strong>supervisor</strong> starts child processes</li><li>The system keeps running</li></ol><h3>🟦 Go mindset</h3><p>“Start at main() and execute step by step.”</p><h3>🟩 Node.js mindset</h3><p>“Run this file and react to events.”</p><h3>🟪 Elixir mindset</h3><p>“Start a system of processes that run and supervise each other.”</p><p>Entry points aren’t just syntax. They shape how you design systems.</p><ul><li><strong>Go</strong> → You control everything from main()</li><li><strong>Node.js</strong> → You react to events from a script</li><li><strong>Elixir</strong> → You define a system that runs itself</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=88a324f29273" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Elixir Phoenix with Parcel]]></title>
            <link>https://medium.com/@heinzeya/elixir-phoenix-with-parcel-8910a6167c7a?source=rss-2566ca14bbaf------2</link>
            <guid isPermaLink="false">https://medium.com/p/8910a6167c7a</guid>
            <category><![CDATA[elixirlang]]></category>
            <category><![CDATA[phoenix-framework]]></category>
            <category><![CDATA[parcel-js]]></category>
            <dc:creator><![CDATA[Hein Zeya]]></dc:creator>
            <pubDate>Sat, 18 Apr 2020 11:47:54 GMT</pubDate>
            <atom:updated>2020-04-18T13:14:38.397Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*t_hZ4iZpjz7XF-7gYqHp_Q.jpeg" /></figure><p>When we create a phoenix project, it will automatically include web pack inside. This is the guide to switch to parcel in the phoenix project.</p><p><a href="https://github.com/heinzeya/parcel_app">https://github.com/heinzeya/parcel_app</a></p><blockquote>mix phx.new my_app</blockquote><blockquote>delete webpack.config.js from project</blockquote><p>my_app<br>├── assets<br>│ ├── css<br>│ └── webpack.config.js</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/525/1*NQ3aA72DD41uyjpX7PGPlA.png" /></figure><blockquote>remove all dev-dependencies related to webpack</blockquote><blockquote>cd assets &amp;&amp; npm i parcel — save &amp;&amp; npm i parcel-plugin-stdin sass — save-dev</blockquote><p>from config/dev.exs</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/501/1*NNEHAVjOMr0MGQMhCqB-FQ.png" /></figure><p>replace watchers with the following</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UtFPhdyaZdyayj-8XzI6Tw.png" /></figure><blockquote>change scripts from assets/package.json</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/507/1*PI2bYpVAw13IDK6lTBuuDA.png" /></figure><blockquote>“deploy”: “mkdir -p ../priv/static/ &amp;&amp; cp -R static/* ../priv/static/ &amp;&amp; parcel build js/*.js — out-dir ../priv/static/dist — public-url /dist — no-cache”,</blockquote><blockquote>“watch”: “mkdir -p ../priv/static/ &amp;&amp; cp -R static/* ../priv/static/ &amp;&amp; parcel watch js/*.js — out-dir ../priv/static/dist — public-url /dist”</blockquote><p>layout/app.html.eex</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/922/1*ohHvXQmR-IBPygHRLbrNlw.png" /></figure><blockquote>change /js/app.js to /dist/app.js <br>change /css/app.css to /dist/app.css</blockquote><blockquote><strong>rename</strong> all these followings<br>assets/css folder to scss<br>assets/css/app.css to app.scss<br>assets/css/phoenix.css to phoenix.scss</blockquote><blockquote><strong>remove</strong> import app.css in app.js<br><strong>add</strong> <em>import</em> “../scss/app.scss”</blockquote><p><strong>Finally, run the application</strong></p><blockquote>iex -S mix phx.server</blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8910a6167c7a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Build Elixir Project from Scratch]]></title>
            <link>https://medium.com/@heinzeya/build-elixir-project-from-scratch-4fc07cba2db1?source=rss-2566ca14bbaf------2</link>
            <guid isPermaLink="false">https://medium.com/p/4fc07cba2db1</guid>
            <category><![CDATA[elixir]]></category>
            <dc:creator><![CDATA[Hein Zeya]]></dc:creator>
            <pubDate>Mon, 01 Jul 2019 13:42:06 GMT</pubDate>
            <atom:updated>2019-07-01T13:42:06.209Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/768/1*MAJ5kAHoChwCuoJmbgc_Pw.jpeg" /></figure><blockquote>What is elixir project and mix?</blockquote><p>Mix is a build tool that provides tasks for creating, compiling, and testing Elixir projects, managing its dependencies, and more.</p><p>If we use $ mix new my_app -sup , it will create a supervisor app which ismy_app with necessary files like this.</p><pre>my_app<br>├── config<br>│   └── config.exs<br>├── lib<br>│   ├── my_app<br>│   │   └── application.ex<br>│   └── my_app.ex<br>├── mix.exs<br>├── README.md<br>└── test<br>    ├── my_app_test.exs<br>    └── test_helper.exs</pre><p>But I like to make a try DIY way :)</p><blockquote>First, create a file “application.ex” as the following. This is our main application.</blockquote><pre>defmodule MyApp do<br>  use<strong> </strong>Application<br>end</pre><blockquote>Then we need to create a mix file to load our main application</blockquote><pre>defmodule MyProject do<br>  use<strong> </strong>Mix.Project<br>  <br>  def project do<br>    [ app: :my_app, version: &quot;0.1.0&quot; ]<br>  end<br>end</pre><blockquote>Just run IEX with load Script</blockquote><pre>$ iex -S mix</pre><blockquote>Then please check the following command.</blockquote><pre>$ Application.started_applications()</pre><pre>[<br>  {:<strong>my_app</strong>, &#39;<strong>my_app</strong>&#39;, &#39;0.1.0&#39;},<br>  {:mix, &#39;mix&#39;, &#39;1.8.1&#39;},<br>  {:iex, &#39;iex&#39;, &#39;1.8.1&#39;},<br>  {:elixir, &#39;elixir&#39;, &#39;1.8.1&#39;},<br>  {:compiler, &#39;ERTS  CXC 138 10&#39;, &#39;7.3.1&#39;},<br>  {:stdlib, &#39;ERTS  CXC 138 10&#39;, &#39;3.7.1&#39;},<br>  {:kernel, &#39;ERTS  CXC 138 10&#39;, &#39;6.2&#39;}<br>]</pre><p>Our Application has started !! Well DONE</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4fc07cba2db1" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Compile Your Elixir Code]]></title>
            <link>https://medium.com/@heinzeya/compile-your-elixir-code-22586cfb812a?source=rss-2566ca14bbaf------2</link>
            <guid isPermaLink="false">https://medium.com/p/22586cfb812a</guid>
            <category><![CDATA[elixir]]></category>
            <dc:creator><![CDATA[Hein Zeya]]></dc:creator>
            <pubDate>Sun, 16 Jun 2019 03:34:55 GMT</pubDate>
            <atom:updated>2019-06-16T03:34:55.880Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*G36gbIrMxb9HWDv6T4Vorg.png" /></figure><p>Elixir is a pretty cool language and has many different ways to run your application.</p><h3><em>Compile in Memory</em></h3><blockquote>First, create a new file hello.ex and write simple module as following.</blockquote><pre><strong>defmodule</strong> HelloWorld <strong>do</strong><br>  <strong>def</strong> say() <strong>do</strong><br>    IO.puts &quot;Hello World!<br>  <strong>end</strong><br><strong>end</strong></pre><blockquote>Compile in Memory and load into Iex</blockquote><pre>$ iex hello.ex<br>iex(1)&gt; HelloWorld.say</pre><blockquote>Create a new file hello2.ex</blockquote><pre><strong>defmodule</strong> HelloWorld <strong>do</strong><br>  <strong>def</strong> say() <strong>do</strong><br>    IO.puts &quot;Hello World!<br>  <strong>end</strong><br><strong>end</strong><br>HelloWorld.say()</pre><blockquote>Compile in Memory and execute it.</blockquote><pre>$ elixir hello2.ex</pre><h3>Compile to Beam File</h3><blockquote>Compile file and execute it</blockquote><pre>$ elixirc hello2.ex</pre><p>Compile file and load into iex</p><pre>$ iex&gt; c &quot;hello.ex&quot;</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=22586cfb812a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Elixir First Attempt]]></title>
            <link>https://medium.com/@heinzeya/elixir-first-attempt-5b665c5808ce?source=rss-2566ca14bbaf------2</link>
            <guid isPermaLink="false">https://medium.com/p/5b665c5808ce</guid>
            <category><![CDATA[elixir]]></category>
            <dc:creator><![CDATA[Hein Zeya]]></dc:creator>
            <pubDate>Sat, 15 Jun 2019 12:57:58 GMT</pubDate>
            <atom:updated>2019-06-15T12:57:58.316Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vVfOU31siOWGrNatDyLZ3A.jpeg" /></figure><p>Every time you start learning a new programming language, you will start to write a Hello World program.</p><p>Let’s start an interactive Elixir session.</p><pre>$ <strong>iex -S mix</strong></pre><pre>Interactive Elixir (1.8.1) - press Ctrl+C to exit (type h() ENTER for help)</pre><pre>iex(1)&gt; &quot;Hello world&quot;</pre><pre>Hello world</pre><p>Now let’s add a function to return “Hello World”</p><pre>iex(2)&gt; defmodule HelloWorld do<br>...(2)&gt;   def hello do<br>...(2)&gt;     IO.puts &quot;Hello world&quot;<br>...(2)&gt;   end<br>...(2)&gt; end</pre><p>Let&#39;s call that function</p><pre>iex(3)&gt; HelloWorld.hello<br>Hello world<br>:ok<br>iex(4)&gt;</pre><p>Now create a new file “test.ex” and paste the following.</p><pre>defmodule HelloWorld do<br>  def hello do<br>    IO.puts &quot;Hello world&quot;<br>  end<br>end</pre><pre>HelloWorld.hello()</pre><p>Now time to run</p><pre>$ elixir test.ex</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5b665c5808ce" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Progress or Outcome]]></title>
            <link>https://medium.com/@heinzeya/progress-or-outcome-efa2083abad3?source=rss-2566ca14bbaf------2</link>
            <guid isPermaLink="false">https://medium.com/p/efa2083abad3</guid>
            <category><![CDATA[education]]></category>
            <dc:creator><![CDATA[Hein Zeya]]></dc:creator>
            <pubDate>Fri, 29 Dec 2017 03:01:00 GMT</pubDate>
            <atom:updated>2017-12-29T03:01:51.061Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/225/1*uCYhGCIdn-IGzF1-eZZikw.jpeg" /></figure><p>I have read a book recently which brings me to other part of my life. Since my childhood, we have kept interested in the outcome whether success or failure. To be top of the class is our main goal and only one goal nothing else matters.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/291/1*QQpZ_JqgtLAD5xGth4O71w.png" /></figure><p>As the result, we failed to attempt the new things and challenges because we are so afraid of getting failure or judgement of others. We don’t care about the trying. We don’t care about the progress. We only care about the outcome which means that success or failure.</p><p>So we are tying to limit ourselves. We look for the things we can do instead of what we can’t do. And we always need to prove that how smart we are, what capabilities we can do. That is something wrong.</p><p>That book has pointed out the thing we have missed out in our entire life. That is Progress which is growth mindset.</p><p>What it means that you only focus on the progress or learning regardless of the outcome is success or fail. So you have less worry and no pressure at all. You don’t care about what other people think about you and other people judge you. Only what you can learn and improve yourself matters.</p><p>Next time when one problem comes out, if problem is the sort of what you can solve, Do you try to show how smart you are? If the problem is kind of hard to solve, Will you run away?</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=efa2083abad3" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>