Creating distributed and concurrent applications doesn’t have to be difficult. Elixir allows hobbyist and new programmers to easily create projects that can work across multiple nodes. Elixir…
Modifying the source code and knowing that there are no automated tests in place is similar to working at height and knowing that a single mistake could cost you your life.
A Quick Way to Add Username and Passwords to Your Python Scripts
The other day I was asked: How do I get usernames and passwords into my Python scripts? For example to use with Netmiko, Scrapli or Nornir. The simple answer to this is the library python-dotenv. Whats python-dotenv? python-dotenv is a library that loads your environment variables from a .env file.
Python is a powerful programming language that can be used for a wide range of tasks. One of those tasks is organizing files. With just a few lines of code,
This all started with a simple question about the R programming language: _is R lexically or dynamically scoped?_ To answer that question, we need to understand what _scope_ is, along with _lexical scope_ and _dynamic scope_....
This recording is part of the Packet Coders member Tech Sessions. Within this tech session we cover: Why Go? Reasons why people choose Go Go for network engineers Go vs (Python | Ruby | C | Rust) Intro to Go Go proverbs Go tool Types system Interfaces Concurrency Network automation overview SSH HTTP
Database Modeling With Ecto Part 2 - has many and belongs to Relationships
Previously, we created the initial Phoenix app and created a Teacher struct and table. We went over how to perform the basic CRUD operations as well as how to do some basic tests to verify the functionality. In part 2, we’re going to be adding more structs and defining relationships between them. We’ll also go over how to fetch records with their associations.
If you haven’t been following along, you can checkout the code from GitHub and fetch the branch:
Add Tags with Ecto has_many, through in Phoenix - Tagging part 1
I want to add tags to products. And as usual there are a situation where a product can have many tags and a tag can belong to many products.
However, in my opnion, the best option is to use a 'has_many :through' relationship. So for this, I need a table called tags and a join table called taggings.
In this tutorial, I will go through how would do this.
Something I do in EVERY project is to setup some sort of relation between resources. And even though Phoenix comes with generators for migrations and CRUD opeartions, you still need to modify the code to suite for the relations you want.
In this short tutorial, I will go through my usual steps regarding setting up a basic has_many / belongs_to - relation.
Components are a mechanism to compartmentalize state, markup, and events in LiveView. We can move a part of the LiveView's logic (and related template) into separate components. We start by moving the product card, the part inside the for comprehension, into a LiveComponent.