Author Archives: Coding Packets Blog
Author Archives: Coding Packets Blog
Javascript is a dynamically type language. The types of variables are evaluated at runtime based on the contents of the variable. Typescript is a superset of Javascript which adds static typing to the language (amongst other things). There are two kinds of types in Javascript;...continue reading
Like most languages, variables in Javascript are defined with the = operator. There are 3 different keywords that can be used to define a variable. var - Depricated, should not be used for ES6+. let - Variable can be re-assigned. Value can be mutated. const - Variable cannot be...continue reading
Pulumi is an infrastructure as code tool that helps you build and manage environments such as AWS, Azure and GCP with the programming languages you already know. In this post, I will show you how to get up and running with Pulumi. Software The following software was used in this...continue reading
In this post I will cover the process of adding searchable dropdown boxes to your Lucky webapp with the Select2 Javascript library and styling them with Bootstrap 5. Software The following software versions were used in this post. Lucky - 0.28.0 Select2 - 4.1.0-rc.0 Bootstrap -...continue reading
In this post I will show you how to add pagination to a Lucky webapp and also style the pagination links with Bootrap and Font Awesome Icons. Software The following software versions were used in this post. Lucky - 0.28.0 Font Awesome (Free) - 5.15.4 Bootstrap - 5.1.0 Enable...continue reading
In this post I will show you how to add the Font Awesome icons to your Lucky webapp. Software The following software versions were used in this post. Lucky - 0.28.0 Font Awesome (Free) - 5.15.4 Installation Firstly add the fontawesome-free package via yarn. Next, we import the Font...continue reading
This excellent post contains a workaround. Update the src/models/vrfs.cr file. Summary continue reading
By default, new Lucky projects use the Int64 type for primary keys. In this post I will cover the process of changing the Lucky database primary keys type from an Int64 to a UUID. Software Used The following software versions are used in this post. Crystal - 1.1.1 Lucky -...continue reading
In this post, I will show you how to add Bootstrap styling to a Lucky webapp. Software Used The following software versions are used in this post. Lucky - 0.28.0 Bootstrap - 5.1.0 Installation First up, use Yarn to install Bootstrap. Next, import Bootstrap near the top of the ...continue reading
I am a big fan of the web framework Ruby on Rails. Recently, I have been looking into the Crystal programming language and was excited to find out there are a couple of options for web frameworks similar in philosophy to Rails. One of those options is Lucky. "Lucky is a web...continue reading
In this post I will show you how to install Node JS and the Yarn package manager on Ubuntu 2004 server. Software Used Ubuntu - 2004 server Node JS - v16.7.0 Yarn - 22.11 Install Node JS I am installing Node from the node source's distribution. Run the Node JS setup script from...continue reading
I am a big fan of the web framework Ruby on Rails. Recently, I have been looking into the Crystal programming language and was excited to find out there are a couple of options for web frameworks similar in philosophy to Rails. One of those options is Lucky. "Lucky is a web...continue reading
In Crystal, code is imported with the require statement. Considerations The compiler combines all required files together. A file can be required more than once, but only the first require statement has any effect. The standard library on Linux is located in the ...continue reading
Today, my beloved Lenovo P14s Gen 1 had a "computer says noooooo" moment. Since purchasing this machine 6 months ago, it has been rock solid. Then, out of the blue it hits me with a rotating carousel of full screen colours: red, blue, green, white and black. OMG! This is my work...continue reading
Recently, I was trying to reset the root password on an EX2200. Following the normal process of entering single user mode did not work. In this post I will cover the workaround to reset the root password. The Issue On an EX2200/3200/3300/4200/4500/4550 running code version 15.1R1 -...continue reading
Structs have a similiar syntax to a Class and are used to hold data. Considerations Structs are created on the stack and are passed by value. Structs are best suited for small amounts of immutible data. Structs can be mutible, since values are copied, the behaviour is different from a...continue reading
Tuples A Tuple in Crystal is a group if related values of possibly different types. # Access a Tuple element. stuff_and_things[0] # => stuff # Deduce the type of stuff_and_things typeof(stuff_and_things) # => Tuple(String, Symbol, Int32)') }} Named Tuples NamedTuples allow you to create a...continue reading
Strings Strings in Crystal are are declared with double quotes (""). Strings are stored as as sequence of UTF-8 encoded characters. Strings are immutable. Symbols Symbols in Crystal are declared by prefixing a colon (:) to a variable. Every instance of a Symbol is the same...continue reading
Enums group a related number of values and store the values internally as integers. Enums are good to use when the number of values are not too big. Considerations Enums are a type safe alternative to Symbols. It is recommended to use Enums whenever possible and only use Symbols for an...continue reading
Crystal is a object orientated language. Classes are the blueprints from which objects can be created. Class Definition Class Methods Class methods allow you to add behaviour to a class. Variable Access By default, class variables are not accessible from outside the class. You cannot...continue reading