Tag: tricks
-
Pattern Matching Empty MapSets
· 1 min read
Long story short: Elixir MapSets are cool and shall be used widely. Empty MapSets can be pattern-matched easily.
-
Elixir Structs on Steroids
· 3 min read
Tiny library adding validation support, reasonable Access and Collectable implementations and more to Elixir Structs
-
Gospel of Barabbas or Concurrent Execution
· 5 min read
The beginner-friendly explanation of what concurrency is and why it ever matters
-
Iteraptor → Unforeseen utilization
· 3 min read
Using Iteraptor in test environment to test deeply nested maps/lists passed as JSON
-
Idempotent Supervision Tree
· 3 min read
The main advice on how to keep a supervision tree immune to members crashes
-
Plug in JSON API Readonly Webserver
· 2 min read
How to expose some read-only data from the already existing Elixir application with zero code
-
Elixir Compilation Hooks
· 3 min read
How to make custom macro `use` calls safer by checking the conditions met
-
Sigils To The Rescue
· 2 min read
Exvalibur does now allow custom guards and pattern matching of values
-
Iteraptable → Swiss Knife For Structs
· 4 min read
Simple way to make the struct all Enumerable, Collectable and Accessable
-
¡AST FTW!
· 4 min read
Why Abstract Syntax Tree is a core feature of any modern language
-
Smart Validation In Elixir With Exvalibur
· 4 min read
Use generated module with pattern matching clauses and guards to validate any input given as a map
-
ActiveRecord Smell With Elixir/Ecto
· 7 min read
Quick how-to on bringing some ActiveRecord goodness into Elixir/Ecto
-
Generated Module As A Guard
· 4 min read
Better and faster way to implement validation of incoming data than just looking it up in the global config map
-
Better pry for Ruby REPL
· 4 min read
Ruby REPL “pry” is way more powerful than “irb” and might be even better tuned
-
Raise For The Rescue
· 4 min read
When in any incomprehensible situation—raise! Do not let the uncertainty propagate through.
-
SeeAsVee Library For Handy CSV Processing
· 3 min read
The most intelligent library to process CSV files
-
Ruby metaprogramming for beginners → Elixir-like specs
· 6 min read
Hacky implementation of Elixir-like specs in pure ruby with examples
-
RFC HTTP API Feedback Proposal
· 2 min read
RFC for implementing API HTTP responses in 6xx codes area
-
Protocols in Ruby → Allow Implicit Inheritance
· 2 min read
Dry-behaviour ruby library implementing Elixir protocols for Ruby going towards 1.0 release
-
Adopting Property Testing in Elixir
· 4 min read
Property testing gives way more assurance in many cases than other testing techniques
-
Tarearbol now allows subscriptions to task results
· 2 min read
Tarearbol gracefully uses Envío’s functionality to subscribe to task execution results
-
Envío as a reincarnation of GenEvent²
· 3 min read
Publishing and subscribing to events with ease
-
These Weird Accents
· 4 min read
The detailed how-to on dealing with strings having accents nowadays
-
Elixir Iteraptor :: Iterating Nested Terms Like I’m Five
· 6 min read
The tiny elixir library to iterate/map/filter deeply nested structures in Elixir
-
Iteraptor :: Iterating Nested Terms Like I’m Five
· 4 min read
The tiny library (200 LOC) to iterate/map/filter deeply nested structures in Ruby
-
Elixir Pipeline Operators
· 3 min read
What operators can be used in Elixir for pipelining and how
-
Beware of YAGNI
· 3 min read
How to stop procrastinating and start to be a good developer
-
Pattern matching on binaries takes over Regex
· 3 min read
Cumbersome pattern matching might be way better than parsing strings with regexps
-
Automate pattern matching for structs
· 5 min read
How to bulk pattern match structs in function clauses in Elixir
-
Pattern matcher for Protocols
· 3 min read
How to pattern match a protocol in Elixir
-
.iex.exs to the rescue
· 3 min read
How to tune up your project environment in Elixir
-
Idiomatic function memoization in Elixir
· 3 min read
How to memoize the function in Elixir
-
Unveil Erlang Code of Your Elixir Project
· 2 min read
How to see what erlang code was compiled to run your Elixir project
-
Workflow as FSM: lost transitions
· 3 min read
building a robust FSM for a workflow
-
StringNaming to call UTF8 by name
· 7 min read
compile-time generated set of modules to ease an access to a predefined subset of UTF8 symbols
-
Define module in Elixir with initial binding
· 8 min read
tiny library that provides the same binding mechanism as quote bind_quoted: [] does
-
Use `credo` Linter in Git `pre-commit` Hook
· 4 min read
copy-paste solution to start using credo linter in git pre-commit hook
-
`is_empty` Guard for Binaries in Elixir
· 1 min read
nifty trick that provides the same functionality as [not existing] is_empty guard
-
Hack vs Kludge
· 1 min read
what is the difference between an elegant hack and a nasty kludge on a linguistic example
-
Command line application wrappers problem
· 1 min read
Problem with shell script wrappers in non-default I18N environment
-
Debug inplace
· 1 min read
Example of using PRY for inplace debugging in ruby
-
Sequentional execution: example of Reactor pattern impl
· 2 min read
Basic example of Reactor pattern implementation within two threads
-
Collage directory preview with RMagick
· 1 min read
Monkeypatch for RMagick to produce collages
-
Ruby Shorthand to Yield Within Blocks
· 1 min read
Example of using shorthand to yield keyword
-
Match or Not Die
· 1 min read
Match string painless without superfluous if-then clauses
-
Delightful Logging
· 1 min read
Facilitation of dealing with Logger
-
Make Hash Element Access Painless
· 1 min read
Provide a common mechanism to access deeply nested hash elements w/o annoying exception handling
-
Ruby Logger :: Temporary Enable Debug for One Class
· 1 min read
How to enable debug for a couple of classes only
-
Shorthands in Ruby Code Blocks
· 1 min read
Syntactic sugar using ampersand notations
-
Multiple Match in Ruby
· 1 min read
Matching all the occurences of a pattern returning MatchData
-
EventMachine :: Nested Calls
· 3 min read
Yield ⇒ Choose one ⇒ Yield