TOC: Crystal Programming
- Introduction
- Crystal Language
- Crystal Shards (3rd party libraries)
- How to install 3rd party shards?
- Install Crystal
- Crystal in Docker on Linux
- Hello World (puts)
- Run Crystal source code
- Compile Crystal to executable
- Speed of Crystal
- Hello World (print)
- Hello Name (variables)
- Hello Name with interpolation
- Interpolation
- Escaping - Alternative quote as delimiters
- Debugging print p!
- Comments
- Code formatting
- Types - typeof
- Compound Types - typeof
- Add numbers - concatenate strings
- Add mixed strings and Integers
- Numeric Operators
- Methods of Int32
- Methods of Float64
- Program name
- Command line arguments - ARGV
- Early exit
- Rectangle
- True values
- Math - PI
- Read from STDIN
- Read number from STDIN
- Interactive environments
- Crystal one-liners
- Crystal and random numbers
- Exercise: Hello World
- Exercise: Hello Name - STDIN
- Exercise: Hello Name - ARGV
- Exercise: Circle STDIN
- Exercise: Circle ARGV
- Exercise: Calculator STDIN
- Exercise: Calculator ARGV
- Exercise: Age limit
- Strings
- Strings intro
- Length or size of a string
- Locate substring (index, rindex)
- Reverse a string
- Substring, range of characters
- String includes another string
- String starts with
- String ends with
- Replace part of a string (substitute)
- Is the string empty or blank?
- Iterate over characters of a string
- Type conversion from string to float, to int
- Converting string to integer or float
- Split String
- String Transliteration
- String Builder
- sprintf and %
- Split to the same string length
- Split characters
- printf
- Here documents
- Conditionals
- Comparison Operators
- Spaceship operator
- if statement
- elsif
- unless statement
- Suffix if
- Suffix unless
- Logical operators
- Truth-table
- case / when
- case of types
- Ternary operator and or to set default value
- Exercise: Number Guessing game - level 0
- Solution: Number Guessing game - level 0
- Loops
- loop
- loop controls (next, break)
- while
- until
- Exercise: Number guessing game
- Solution: Number guessing game
- Arrays
- Arrays intro
- Array elements - indexing
- Array iterate over (each, each_with_index)
- Array push, append, <<
- Empty array
- Count digits
- Operations on arrays
- Add arrays
- Repeat arrays
- Select (filter, grep)
- Reject (negative filter, grep)
- Transform with map
- Sample from array
- Shuffle array
- join
- Remove nil elements
- Create Array with nil
- Does array include a value
- Delete element from array by value
- Delete element from array by location
- Insert element into array at location
- Arrays shift - remove first element
- Arrays uniq elements
- First element of the array
- Permutations
- Hash
- Hash intro
- Count words
- Create empty hash
- Hash and types
- Hash get value, get default value
- Merge hashes
- Delete - remove an element from a hash
- Reject - remove an element from a hash
- Clear - empty a hash
- Select - keep certain key-value pairs
- Multi-dimensional hash
- Dig a hash
- Files
- Files intro
- Read from file (slurp)
- Read lines into array
- Read file line-by-line
- Write to file
- Append to file
- Does file exist?
- Size of file?
- Last Modified date of file?
- Counter
- Multi Counter JSON
- Multi Counter YAML
- Directories
- List directory content
- List directory tree
- Get Current working directory (cwd, pwd)
- Temporary directory
- Tempdir function
- Join / concatenate file system path
- Join / concatenate file system path
- Path from string
- Expand Path
- Sets
- Create empty set
- Set examples
- Functions
- Functions and methods
- Function return value
- Function parameter passing
- Function parameter default value
- Wrong number of arguments
- Any number of arguments (splat, *)
- Manually separate
- Tuple from
- Array overload
- Multiple dispatch
- Implicit return value
- Return Type definition
- Type or Nil
- Yield
- Yield with parameters
- Block and parameters
- Tuples and Named Tuples
- Create Tuple
- Create Named Tuple
- Access fields of Named Tuple
- Named Tuple with non-alphanumeric fields
- Named Tuple with optional field
- Structs
- Empty struct
- Initialize immutable struct
- Initialize immutable struct - shorthand
- Immutable struct with getters
- Immutable struct with getter macro
- Mutable Struct with setter
- Mutable Struct with property macro
- Struct with optional attributes
- Struct with default value
- Struct pass-by-value
- Struct from JSON
- Struct from JSON - upper case
- Struct both from JSON and initialize
- Struct from JSON - manual parsing
- Multi-level struct manually
- Multi-level struct from JSON
- Struct from JSON with extra data
- Struct from JSON missing data (optional fields)
- Extend struct
- Extend other structs
- Classes
- Empty Class definition
- Class with attributes
- Class with getters
- Class with setter
- Class with getters and setter (property)
- Class with property with default value
- Class with declared getter and default value
- Class with declared getter
- Serialize Crystal-lang class to/from JSON from_json to_json
- Compare objects for equality
- Singleton using class properties
- Singleton using class properties with default values
- Class monkey-path add method
- Stringification to_s
- Regexes
- Alternate delimiter matching slashes
- Substitute
- gsub
- Testing
- Testing 1
- Testing with Spec
- Modules
- Namespace
- Extend class - include module
- JSON
- JSON (to_json, parse)
- JSON to NamedTuple
- Reading a JSON file
- JSON to Array
- Range
- Range using dots
- Range using a class
- Range - sum
- Range - count
- Range and loop controls
- Range with step
- Range to Array
- Random
- rand
- Random in other parts of Crystal
- Random as a class
- Random - seed
- YAML
- Parse YAML
- Exception Handling in Crystal-lang
- Catch exception - begin, rescue
- Raise exception
- Logging
- Crystal logging
- SQLite
- Try SQLite
- Multi-counter with SQLite
- SQLite last_id last_insert_id
- SQLite UPDATE row_affected
- SQLite exception handling (during INSERT)
- SQLite all
- SQLite in memory
- Time
- Dates and Time
- Sleep
- Time difference or Time::Span
- Elapsed time
- Timestamp formatting
- Add timespan
- Time Types
- CLI
- ARGV
- Usage statement and exit
- Command line Option Parser (argparse, GetOpts)
- Pass parameters to OptionParser
- Order of parsing
- HTTP Client
- HTTP Client example
- Parse URL (URI)
- HTTP::Request GET
- HTTP::Request POST
- Process
- Execute external program (system)
- Execute external program (backtick)
- Execute external program (Process)
- Execute external program (capture)
- Execute external program (capture)
- Abort
- Concurrency
- Send and receive
- Concurrent HTTP request
- Kemal
- About Kemal
- Kemal Install
- Hello World
- Testing Hello World
- Kemal Autorestart (autoreload)
- Kemal GET parameters
- Kemal POST parameters
- Kemal Route parameters
- Kemal ECR Templates
- Kemal with Jinja templates
- Kemal Elapsed time
- Accept GET, POST, and route parameter in the same POST route
- Kemal indicate 404
- Kemal Styling 404 pages
- Kemal set headers (change content-type)
- Kemal redirect
- Kemal in Docker
- Other
- Sequence
- Check if variable is nil?
- Single quotes vs double quotes
- No type-checking?
- Divide by zero is Infinity
- Require other files
- List Methods
- Checking the slides
- Crystal mine
- Ameba Linter
- Gravatar
- Try Crystal
- STDERR, STDOUT
- Return Boolean
- Symbols
- Docspec
- require
- Constants
- Multiple assignment
- Chained assignment
- Int methods: Times
- Int64 Zero
- Question mark: ?
- Exclamation mark: !
- Ampersand: &
- STDIN don't accept nil
- Math
- Proc
- Enums
- Type of array elements
- Environment variables
- Int32 or Nil
- Resources
- Crystal from 0 to Web site
- Crystal from 0 to Web site
- Background
- Why?
- I can do better
- How to learn
- When
- Shardbox
- What did I learn?
- Crystal is fun
- Shards
- Code formatter
- Ameba - Linter
- Spectator - testing framework
- Code coverage
- CI - GitHub Actions
- The language
- What do ? and ! mean?!
- Emojis and Unicode characters 💎
- Meaning of ?
- Meaning of !
- Web framework?
- Amber Framework
- Lucky Framework
- Kemal
- Crinja
- Shardbox
- Future
- Thank you - QA ?!?!