How to connect Pow and Live View in your Phoenix project
Wrote a short blogpost about connecting Pow and Live View in a Phoenix project. Basically, it is a summary of existing knowledge from the Live View documentation and a long thread in the Elixir forum. I hope it is helpful for others, that enjoy Pow as much as I do.
https://dev.to/oliverandrich/how-to-connect-pow-and-live-view-in-your-phoenix-project-1ga1
11th episode - Autostarting trading strategy - crypto trading in Elixir
11th video in the series about building cryptocurrency trading bot in Elixir - this time we will focus on autostarting, stopping, and graceful shutdown of our naive trading strategy.
Link: https://www.youtube.com/watch?v=Gm2v3E8fmAM&list=PLxsE19GnjC5Nv1CbeKOiS5YqGqw35aZFJ&index=11
Serving open street map vector tiles with elixir and phoenix
https://dev.to/dkuku/serving-open-street-map-vector-tiles-with-elixir-and-phoenix-40ip In this tutorial I’ll use a file has bundled the assets as *.pbf because it’s the most complicated format to set up. With images you don’t need any plugins for leaflet and the rendering should be much faster in user browser.
IntelliJ Elixir v11.9.0
Changelog
Enhancements
-
Make plugin updatable without a restart when installing from the JetBrains Marketplace. (If installing from file on GitHub you still need to restart due to a limitation in the JetBrains API.). JetBrains refers to this as a Dynamic Plugin.
-
Convert
DepsWatcher
from project component to project listener -
Convert
Watcher
from module component to project listener - Make org.elixir_lang.packageManager extension point dynamic
-
Convert
-
Remove unnecessary
assert
. -
Replace
if
withwhen
-
Include
asd
tool version Prevent me screwing up the quoter cache using the wrong elixir version again. -
Update gradle project
-
gradlew
6.7.1
-
org.jetbrains.intellij
0.6.3
-
org.jetbrains.kotlin.jvm
1.3.70
-
de.undercouch.download
to4.4.1
-
- Update to GitHub Environment Files
-
Update CI to Elixir 1.11.2 and Erlang 23.1
-
Quoting (for verification of correspondences between plugin and Elixir native lexer and parser.)
-
Port elixir-lang/elixir#9725
- Indentations for sigil binaries with complex content. Makes sure the indentation metadata is added to sigils that have content with metadata already.
- Quote charlist the same as string when used for a quoted atom
- Port elixir-lang/elixir@e89e9d874bf803379d729a3bae185052a5323a85
-
Add sigil delimiter to metadata
Ports elixir-lang/elixir#9671
- Have 3 character delimiter for heredocs
-
Add
no_parens: true
metadata Port elixir-lang/elixir@8e7befb1087bd37d5acb883e21925b1c0eb0a55f
-
Port elixir-lang/elixir#9725
- Remove elixir-lang parsing tests for files that don’t exist in Elixir 1.11
-
Add missing
@Deprecated
to match overridden method - Format expected and actual quoted Makes the diff not be a one-liner. so easier to spot the difference.
-
Convert
Quoter
to Kotlin - Regenerate Parser for newer GrammarParser version.
- Port elixir-lang/elixir@1e4e05ef78b3105065f0a313bd0e1e78b2aa973e
-
Quoting (for verification of correspondences between plugin and Elixir native lexer and parser.)
-
Rewrote the
DocumentationProvider
so it no longer relies on invokingmix
(which I admit was more like a hack than a real solution). This now works so quickly that it actually makes sense to show docs on mouse hover.- It can get the documentation from both the source code and decompiled .beam files.
- Decompilation of documentation was implemented according to EEP-48.
-
The experience on navigating through decompiled file has also been improved a bit
-
See the
@moduledoc
and@doc
s - See if a function has been deprecated
-
See the original signature of the function (instead of just
p0
,p1
, …).
-
See the
Bug Fixes
-
Fix deprecation warnings for IntelliJ IDEA 2020.2
-
Replace
fileTypeFactory
extensions withfileType
-
Convert
fileType
s to Kotlin -
Replace uses of deprecated
Project#baseDir
-
Replace uses of deprecated
ContainerUtil.newHashMap
-
Replace
defaultLiveTemplatesProvider
withdefaultLiveTemplates
-
spaceExistanceTypeBetweenTokens
replaced withspaceExistenceTypeBetweenTokens
-
Replace
ListCellRendererWrapper
withSimpleListCellRenderer
-
Replace
StdFileTypes.PLAIN_TEXT
withFileTypes.PLAIN_TEXT
-
Replace
LanguageSubstitutors.INSTANCE
withgetInstance()
-
Replace
ReportMessages.ERROR_REPORT
withReportMessages.getErrorReport()
-
Replace
DefaultProgramRunner
withGenericProgramRunner
- Have only one runner for all configurations in plugin since body of runner was all the same for non-debug.
-
Don’t override deprecated
flushBufferBeforeTerminating()
-
Don’t override deprecated
acceptsFile
-
Override
initExtra(Project)
instead ofinitExtra(Project, MessageBus, Engine)
-
Replace
NamedFoldingDescriptor
withFoldingDescriptor
-
Convert
folding.Builder
to Kotlin
-
Convert
-
Replace
file
withvalue
for@Storage
annotation -
Replace
checkBox(fieldName, title)
withcheckBox(title, getter, setter)
-
Replace
com.intellij.util.contains.Predicate
withjava.util.function.Predicate
-
Replace
CodeStyleSettingsManager
withCodeStyle
-
Replace
Comparing.equal
withObjects.equals
-
Replace
UsageType(String)
withUsageType(Supplier)
-
Replace
PluginManager
withPluginManagerCore
-
Replace
WakValueHashMap
withcreateWakeValueMap
-
Don’t pass
Pass
toLineMarkerInfo
-
Replace
newArrayListWithCapacity
withArrayList
-
Replace
newIdentityHashMap
withIdentityHashMap
-
Replace
RefElement#element
with#psiElement
-
Pass
columnMargin
tosetupCheckboxColumn
-
Extensions.getExtensions(name)
->name.extensionList
-
Extensions.findExtension
->ExtensionPointName.findExtensionOrFail
-
Object
->Any
-
Replace
choseAndSetSdk
withSdkPopupFactory
-
Replace
-
Fix error reporting formatting
- Fix new lines around excerpts so that code blocks quote correctly
- Use FILE:LINE format for excerpt location, so it can be used in editors for rapid lookup.
- Separate title from message
-
Remove use of
ErrorBean
- Pass project for LevelPropertyPusher DumbModeTask
-
Don’t use constructor injection for
SetupSDKNotificationProvider
-
Don’t use
AnnotationHolder::create*
APIs and useAnnotationBuilder
instead.-
Convert
Annotator
s to Kotlin
-
Convert
-
Use
logger.error
directly instead ofLogMessageEx
- Fix Atom annotator to only annotator within current element. Annotation keyword pair’s key and colon instead of annotating the keyword key and the colon outside of it.
-
Fix
Macro
parsing inDbgI
-
ifAccessToString
I missed taking the 3rd element of the tuple to get[Access, :get]
and was checking the outer tuple directly.-
Convert
beam.assembly.ParserDefinition
to Kotlin
-
Convert
-
ifWhenToString
whereas
should beas?
-
-
Suppress unused variables for
TODO()
s -
Remove unnecessary
Line
chunk dependency onAtom
chunk -
Switch unused
unsignedInt
values to_
as Kotlin doesn’t support_name
-
Use
key
instead of environment forcomputeIfAbsent
- Replace lambda with constructor reference
-
Remove unnecessary
!!
s -
Replace
mapIndexed
withmap
becauseindex
is unused -
Remove
open
that has no effect inobject
-
Fix
is
overrides by converting to Kotlin -
Remove unused
Call
fromImplementation.
andCallDefinitionClause
.elementDescription(Call, ElementDescriptionLocation)
. -
Don’t shadow
resolveResultList
inaddToResolveResultList
-
Remove useless
?:
-
Remove unnecessary
!= null
- Fix named argument calling by using super argument name
-
Change
Float.from(ByteArray, Int)
toTODO()
as implementation is invalid. -
Remove unused
ModuleChooserDialog
-
Setup
EncodingManager
forParsingTestCase
-
Remove redundant
internal
- Don’t highlight resolved callables along with referrers Newest annotation API asserts that the annotator only annotates the PsiElement being visited, so can’t highlight the resolved call definitions at the same time anymore.
-
Differentiate signs, unary +/-, and addition/subtraction in lexer.
Fix parsing of
-1
forcase
clauses (#1316) by more strictly parsing decimal exponent signs differently than addition/subtraction and differently from unary+
and-
. No longer have a “dual” operation emitted from the lexer like the Elixir native lexer and instead use specific tokens for each use case so that the parser doesn’t need to decide on the operation. - Heredoc with escapable newlines (#1843) Heredocs allow the final newline to be escaped so you can write a heredoc in the code, but have no newlines in the string term at runtime.
- Fix terminators docs to show closing version and not opening version
-
Protect against
IndexOutOfBounds
fromhighlighterIterator
inQuoteHandler
.
Elixir Wizards: Steve Domin on Innovating Travel APIs
This week on Elixir Wizards, we talk with Steve Domin, CEO and Co-Founder of Duffel.com: https://smartlogic.io/podcast/elixir-wizards/s5e6-domin/
Grax 0.1: a graph data mapper for Elixir
Grax is a light-weight graph data mapper which maps RDF graph data on to Elixir structs, like Ecto.Schema
s for graph data.
https://github.com/rdf-elixir/grax
Read all about it in the guide: https://rdf-elixir.dev/grax/
Use the new Enum type in Ecto 3.5
Enums are a great way to safely store user roles, record status updates, and many other things in your database. Ecto 3.5 added Ecto.Enum which makes it easier than ever to persist enums to your database.
https://dennisbeatty.com/use-the-new-enum-type-in-ecto-3-5.html
Mutiny: Simple database immutability
Need database-level assurance that certain records are immutable—that is to say, unable to be UPDATE
d once INSERT
ed? Mutiny is glad to oblige. https://newaperio.com/blog/mutiny
Temple v0.6.0-rc.0 released!
Just released the first RC of Temple v0.6.0! Please check out the diff and try it out to report any issues before I make the official release.
Main improvements are
- Phoenix LiveView compatible
- Improved component API
Diff: https://diff.hex.pm/diff/temple/0.6.0-alpha.4..0.6.0-rc.0
ElixirStatus gets a Dark Theme!
I migrated the ElixirStatus server today and thought this necessary change in hardware was a great opportunity to put a coat of fresh paint on this old ship.
ElixirStatus now honors your preference for “dark” or “light” themes. You can also overwrite this via the “Use (Dark|Light) Theme” link at the bottom of the page (inspired by ExDoc).
Slurp - An EVM block ingestion toolkit for Elixir
Stream blocks & events from multiple EVM blockchains with a near-uniform API
PhoenixLiveSessions: LiveView Integration for Phoenix Sessions
PhoenixLiveSessions is a new library for integrating Phoenix sessions with LiveViews. Store session data from LiveViews and receive session updates via PubSub. https://pentacent.com/blog/phoenix-live-sessions/
High Level Ethereum Library Gets a Stability Release
Connect and communicate via JSON-RPC to Ethereum or EVM based blockchains
Display nginx logs in live dashboard
Parse logs with nimble parsec and display in live dashboard https://dev.to/dkuku/nginx-logs-in-live-dashboard-jk9
display linux ps output in live dashboard
Create custom live dashboard using the table component https://dev.to/dkuku/phoenix-live-dashboard-custom-page-4chj
Elixir Wizards S5E5 Shawn Vo on Elixir as a Competitive Advantage
Latest episode of Elixir Wizards is out today! Check it out here: https://smartlogic.io/podcast/elixir-wizards/s5e5-vo/
ThinkingElixir 028: DepViz and ElixirLS with Jason Axelson
In episode 28 of Thinking Elixir, we talk with Jason Axelson who created the DepViz tool that can help improve your Elixir compile-time experience. Jason explains how to use the tool to identify where compile time dependencies may be causing issues in your project and provides tips on what to do about it. We also cover recent improvements in Elixir 1.11 and coming improvements in 1.12 and what those will mean for you! Jason is also a member of the Elixir-LSP github organization and explains the history of the Elixir-LS project and how it has grown and developed. Jason shares some tips with how to fix Elixir-LS issues when it stops working for you. He also shares some glimpses of where things may go in the future, and more!
Best practices of comprehensions in Elixir
In this article I explain tips and tricks of using for-comprehension in Elixir https://k.lelonek.me/elixir-comprehensions
Writing Rust NIFs
https://www.badykov.com/elixir/2020/12/27/rust-nifs/
Elixir and Erlang are not the most performant options for number-intensive calculations. Fortunately, they provide NIFs (Native Implemented Functions) for delegating such tasks to languages like C and Rust that good at number crunching.
Recently, I had an opportunity to work with / write Rust NIFs. Surprisingly, it’s not as hard as I thought it would be. The only skill you need to do that is the basic knowledge of Rust. In this post, I’ll explain simple steps for writing Rust NIFs and I’ll describe a couple of real-world NIFs as examples.
sync_primitives: synchronize processes using higher-level abstractions than messages
sync_primitives is an Elixir library to make it easier to synchronize processes using higher-level abstractions than messages, such as CyclicBarrier and CountDownLatch, which are inspired from the Java APIs.
Personally, I have found them are very useful in testing agent-based and multi-process Elixir apps.
sync_primitives is on Hex and on HexDocs