Coding Packets Blog

Author Archives: Coding Packets Blog

Elixir Notes: Keyword Lists

Keyword lists are similar to list. They are a sequence of tuples that are enclosed with square brackets [ Considerations Keys must be atoms Keys are ordered based on insertion Keys can be declared more than once Keyword lists are the syntax for passing parameters to...

Elixir Notes: Lists

Lists are a sequence of values that are enclosed with square brackets []. Lists in Elixir are actually stored in memory as linked lists. Each element holds both its value and a pointer to the next element. Considerations To compute the length of a list, the whole list needs to be...

Elixir Notes: Types

Elixir has a number of types similar to most programming languages. Integer Integers are whole numbers. Float Floats are decimal place numbers. Boolean Booleans are true or false values. Atom Atoms are constants where the value is the same as the name of the atom. Atoms are...

Elixir Notes: Maps

Maps are used to store key/value pairs. Maps are defined with curly brackets prefixed with a percent % # Define a map with the hash rocket syntax map = % # Create a map from a list of tuples map = Map.new([ Considerations It is convention to use atoms as keys for maps. When an atom is...

Elixir Notes: Tuples

Tuples are similar to lists except they store all their elements in a contiguous memory block. Tuples are defined with the curly braces Considerations Updating or adding to tuples is expensive, because a new tuple is created in memory.

Elixir Notes: Modules

A module is a collection of functions that can be used to organize your code in a manner similar to namespacing. Modules are defined in Elixir with the defmodule keyword. Considerations Modules must start with an uppercase [A-Z] CamelCase is the formatting convention...

Elixir Notes: Functions

A function is a unit of code that does a thing. With Elixir being a functional language, functions are a core tenant of the language. Elixir has both named functions and anonymous functions. Named Functions Functions are defined in Elixir with the def keyword. Anonymous Functions ...

Palo Alto CLI Tips and Tricks

Handy tips and tricks for working with the Palo Alto network CLI. Config Output Format The configuration output format can be changed. This can be useful for backing up the config or capturing a structured format from the CLI. The following formats are available: default json ...
1 7 8 9 10 11 28