# \#code-snippets

**URL:** https://forum.elixirforum.com/tag/code-snippets/60.md

[Latest](https://forum.elixirforum.com/latest.md) · [Categories](https://forum.elixirforum.com/categories.md) · [Tags](https://forum.elixirforum.com/tags.md)

---

## [VSCode Custom User Snippets For '\*\_live.html.heex' Templates Not Working](https://forum.elixirforum.com/t/vscode-custom-user-snippets-for-live-html-heex-templates-not-working/48481)

<div class="topic-metadata">

**Author:** [@romenigld](https://forum.elixirforum.com/u/romenigld)\
**Replies:** 2\
**Last updated:** [June 23, 2022, 1:10pm UTC](https://forum.elixirforum.com/t/vscode-custom-user-snippets-for-live-html-heex-templates-not-working/48481 "2022-06-23T13:10:34Z")

</div>

I am trying to use the snippet’s code from the liveview course of the pragprog which I loved to use on the files \*\_live.html.heex. The snippet’s code is working very well ins the the render functions like: def render(a…

---

## [VS Code regex issue | Elixir snippets](https://forum.elixirforum.com/t/vs-code-regex-issue-elixir-snippets/42326)

<div class="topic-metadata">

**Author:** [@williamthome](https://forum.elixirforum.com/u/williamthome)\
**Replies:** 5\
**Last updated:** [September 14, 2021, 8:51am UTC](https://forum.elixirforum.com/t/vs-code-regex-issue-elixir-snippets/42326 "2021-09-14T08:51:22Z")

</div>

Hi! In this issue for my pull request in vscode-elixir-snippets, I could not find a solution to the problem. My regex looks like this ${RELATIVE\_FILEPATH/^(\[^\\\\/\\\\\\\\\]+\[\\\\/\\\\\\\\\])|(\\\\.ex|\\\\.exs)$|(\[^.\_\\\\/\\\\\\\\\]+)|\_|(\[\\\\/…

---

## [Beautiful Pipelines](https://forum.elixirforum.com/t/beautiful-pipelines/18002)

<div class="topic-metadata">

**Author:** [@Qqwy](https://forum.elixirforum.com/u/Qqwy)\
**Replies:** 1\
**Last updated:** [November 19, 2018, 7:53pm UTC](https://forum.elixirforum.com/t/beautiful-pipelines/18002 "2018-11-19T19:53:17Z")

</div>

Inspired by this topic I thought it might be interesting to talk about what pipelines we have encountered in the wild: Whenever you come across a piece of code featuring a pipeline that you think is cool or elegant, fe…

---

## [Code snippets to compare Erlang and Elixir syntax](https://forum.elixirforum.com/t/code-snippets-to-compare-erlang-and-elixir-syntax/16443)

<div class="topic-metadata">

**Author:** [@leifericf](https://forum.elixirforum.com/u/leifericf)\
**Replies:** 12\
**Last updated:** [September 10, 2018, 5:59pm UTC](https://forum.elixirforum.com/t/code-snippets-to-compare-erlang-and-elixir-syntax/16443 "2018-09-10T17:59:29Z")

</div>

Hello, friends! Context: As you might know from this thread, I’m working on a presentation. Following a tour of Erlang history, I have a slide which reads: “If Erlang is so great, then why should I bother with Elixi…

---

## [List\_to\_port in OTP \< 20.0](https://forum.elixirforum.com/t/list-to-port-in-otp-20-0/9494)

<div class="topic-metadata">

**Author:** [@hazardfn](https://forum.elixirforum.com/u/hazardfn)\
**Replies:** 0\
**Last updated:** [October 20, 2017, 10:55pm UTC](https://forum.elixirforum.com/t/list-to-port-in-otp-20-0/9494 "2017-10-20T22:55:35Z")

</div>

Hey all, I recently needed to get a port() from a string representation of it for…reasons. I discovered a handy little function in OTP 20.0 called list\_to\_port but quickly found out that ONLY works in 20.0+. I mashed t…

---

## [How To Do A For Loop In Elixir (using only recursion)](https://forum.elixirforum.com/t/how-to-do-a-for-loop-in-elixir-using-only-recursion/595)

<div class="topic-metadata">

**Author:** [@Onor.io](https://forum.elixirforum.com/u/Onor.io)\
**Replies:** 28\
**Last updated:** [September 27, 2016, 9:19pm UTC](https://forum.elixirforum.com/t/how-to-do-a-for-loop-in-elixir-using-only-recursion/595 "2016-09-27T21:19:06Z")

</div>

One question that came up for me when I first started with FP was how to do things that I was able to do in imperative without mutable variables. One that was tricky was trying to figure out how to do a for loop with no…
