Находки в опенсорсе
10.6K subscribers
11 photos
1 video
3 files
816 links
Привет!

Меня зовут Никита Соболев. Я занимаюсь опенсорс разработкой полный рабочий день.

Тут я рассказываю про #python, #c, опенсорс и тд.
Поддержать: https://boosty.to/sobolevn
РКН: https://vk.cc/cOzn36

Связь: @sobolev_nikita
Download Telegram
​​Daat is an experimental library meant to provide parameterized modules to #elixir.

Imagine that you have a module named UserService, that exposes a function named follow/2. When called, the system sends an email to the user being followed. It would be nice if we could extract actually sending the email from this module, so that we aren't coupling ourselves to a specific email client, and so that we can inject mocks into the service for testing purposes.

By using parameterized, or higher-order modules, we can instead define a module that specifies an interface, and acts as a generator for modules of that interface. By then passing our dependencies to this generator, we are able to dynamically create new modules that implement our desired behaviour.

https://github.com/QuinnWilton/daat
​​NimbleParsec is a simple and fast library for text-based parser #elixir combinators.

Combinators are built during runtime and compiled into multiple clauses with binary matching. This provides the following benefits:

- Performance: since it compiles to binary matching, it leverages many Erlang VM optimizations to generate extremely fast parser code with low memory usage
- Composable: this library does not rely on macros for building and composing parsers, therefore they are fully composable. The only macros are defparsec/3 and defparsecp/3 which emit the compiled clauses with binary matching
- No runtime dependency: after compilation, the generated parser clauses have no runtime dependency on NimbleParsec. This opens up the possibility to compile parsers and do not impose a dependency on users of your library
- No footprints: NimbleParsec only needs to be imported in your modules. There is no need for use NimbleParsec, leaving no footprints on your modules

The goal of this library is to focus on a set of primitives for writing efficient parser combinators. The composition aspect means you should be able to use those primitives to implement higher level combinators.

https://github.com/dashbitco/nimble_parsec
​​Cloister: The helper application to manage cluster of #elixir nodes.

> Cloister is being developed with the drop-in support of Docker. Distributed Erlang is a charm to work with unless your DevOps team is engaged in containerizing the whole universe. They usually have many cryptic arguments full of words you as an old-school software engineer would barely understand, and sooner or later you are faced with a fact that now we run everything in a dockerized environment, which means no one can guarantee your application has an IP/DNS, or would not have automatically restarted depending on the current moon phase.

> That is where cloister might step into to help. It takes care about the cluster handling, based on either the list of node names (IP/DNS, old school,) or a service name exposed by docker.

https://github.com/am-kantox/cloister
​​Listens to changes in a PostgreSQL Database and broadcasts them over websockets.

It works like this:

1. the Phoenix server listens to PostgreSQL's replication functionality (using Postgres' logical decoding)
2. it converts the byte stream into JSON
3. it then broadcasts over websockets.

https://github.com/supabase/realtime

#elixir
WebPipe allows you to pipe from your servers to the browser!

Just a single command to run:

docker run --rm --publish 8000:8000 hyperngn/webpipe


https://github.com/hyperngn/webpipe

#elixir
​​kaffy: Powerfully simple admin package for phoenix applications.

Kaffy was created out of a need to have a powerfully simple, flexible, and customizable admin interface without the need to touch the current codebase. It was inspired by django’s lovely built-in admin app and rails’ powerful activeadmin gem.

https://aesmail.github.io/kaffy/

#elixir
​​Nicene is a collection of extra Credo checks for linting #elixir code.

https://github.com/sketch-hq/nicene
​​Build reactive applications with the #ruby on Rails tooling you already know and love.

You just discovered an exciting new way to build modern, reactive, real-time apps with Ruby on Rails. StimulusReflex eliminates the complexity imposed by full-stack frontend frameworks. And, it's fast.

Inspired by #elixir's LiveView feature.

https://github.com/hopsoft/stimulus_reflex

Personal opinion: one can better use Elixir and Phoenix if LiveView is required.
​​Helpful #elixir assertions for ExUnit

There are three things this library offers:

- Concise, expressive assertions for common types of tests
- Flexibility through composition
- Exceptional error messages

https://github.com/devonestes/assertions
​​Domo is an #elixir library to model a business domain with type-safe structs and composable tagged tuples.

It's a library to define what piece of data is what and make a dialyzer and run-time type verification to cover one's back, reminding about taken definitions.

The library aims for two goals:

-to allow a business domain entity's valid states with a struct of fields of generic and tagged types
- to automatically verify that the construction of the entity's struct leads to one of the allowed valid states only

The validation of the incoming data is on the author of the concrete application. The library can only ensure the consistent assembly of that valid data into structs according to given definitions throughout the app.

https://github.com/IvanRublev/Domo

Both ids for User and Order structs are of the integer type. How to ensure that we don't mix them up throughout the various execution paths in the application? One way to do that is to attach an appropriate tag to each of the ids with tagged tuple like the following:
​​Unobtrusive Dependency Injector for #elixir

definject is a useful macros for transpaling normal functions into dependency-aware ones. It does not require you to modify function arguments or body. Instead, you just need to replace def with definject. It also allows injecting different mocks to each function. It also does not limit using :async option as mocks are contained in each test function.

https://github.com/definject/definject

Example:
​​New Gleam website!

For ones who don't know about Gleam yet:

> Gleam is a fast, friendly, and functional language for building safe, scalable systems!

Features:

- Safe: Gleam's powerful static type system helps find and prevent bugs at compile time, long before it reaches your users. It also serves as a productive refactoring tool, enabling programmers to confidently make large changes to unfamiliar code, quickly and with low risk. For problems the type system can't solve (such as your server being hit by a bolt of lightning) the Erlang virtual machine provides well tested mechanisms for gracefully handling failure.

- Friendly: Hunting down bugs can be stressful so Gleam's compiler provides clear and helpful feedback about any problems. We want to spend more time developing features and less time looking for bugs or deciphering cryptic error messages. As a community we want to be friendly too. People of all backgrounds, genders, and experience levels are welcome and must receive equal respect. See our community code of conduct for more.

- Performant: Gleam builds on top of the Erlang virtual machine, a best-in-class runtime that has enabled companies such as WhatsApp, Ericsson, Heroku, and Klarna to provide low-latency services at a global scale. Gleam takes full advantage of the Erlang runtime and adds no overhead of its own, so all Gleam programs are as blazingly fast as their #erlang counterpart.

- Erlang compatible: Gleam makes it easy to use code written in other BEAM languages such as Erlang, #elixir and LFE, so there's a rich ecosystem of thousands of open source libraries for Gleam users to make use of. In return Gleam code can be easily used by programmers of other BEAM languages, either by transparently making use of libraries written in Gleam, or by adding Gleam modules to their existing project with minimal fuss.

https://gleam.run

#gleam