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

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

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

Связь: @sobolev_nikita
Download Telegram
​​Livebook is a web application for writing interactive and collaborative code notebooks for #elixir, built with Phoenix LiveView. Inspired by Jupyter and Deepnote.

It features:
- Code notebooks with Markdown support and Elixir cells where code is evaluated on demand.
- Shareable: notebooks are stored in the .livemd format, which is a subset of Markdown with annotations and KaTex for mathematical formulas. This means your notebooks can be saved, easily shared, and play well with version control.
- Interactive widgets via Kino: manipulate Vega-Lite charts, tables, and more.
- Rich code editor through Monaco: with support for autocompletion, inline documentation, code formatting, etc.
- Reproducible: Livebook ensures your code runs in a predictable order, all the way down to package management. It also tracks your notebook state, annotating which parts are stale.
- Custom runtimes: when executing Elixir code, you can either start a fresh Elixir instance, connect to an existing node, or run it inside an existing Elixir project, with access to all of its modules and dependencies. This means Livebook can be a great tool to provide live documentation for existing projects.
- Persistence: persist your notebooks to disk or any S3-compatible cloud storage.
- Collaboration: multiple users can work on the same notebook at once. It works out-of-the-box either in single-node or multi-node deployments - without a need for additional tooling.

https://github.com/livebook-dev/livebook
​​Dataframes for #elixir

Explorer is a dataframe library for Elixir. First and foremost, Explorer is an API for data manipulation. Its high-level features are:
- Simply typed series: :float, :integer, :boolean, :string, :date, and :datetime.
- A powerful but constrained and opinionated API, so you spend less time looking for the right function and more time doing data manipulation.
- Pluggable backends, providing a uniform API whether you're working in-memory or (forthcoming) on remote databases or even Spark dataframes.
- The first (and default) backend is based on NIF bindings to the blazing-fast polars library.

The API is influenced heavily by Tidy Data and borrows much of its design from dplyr.

The aim here isn't to have the fastest dataframe library around (though it certainly helps that we're building on one of the fastest). Instead, we're aiming to bridge the best of many worlds:
- the elegance of dplyr
- the speed of polars
- the joy of Elixir

That means you can expect the guiding principles to be 'Elixir-ish'. For example, you won't see the underlying data mutated, even if that's the most efficient implementation. Explorer functions will always return a new dataframe or series.

https://github.com/elixir-nx/explorer
​​Ain is a terminal HTTP API client. It's an alternative to postman, paw or insomnia.

Features:
- Flexible organization of API:s using files and folders.
- Use shell-scripts and executables for common tasks.
- Put things that change in environment variables or .env-files.
- Share the resulting curl, wget or httpie command-line.
- Pipe the API output for further processing.
- Tries hard to be helpful when there are errors.

Ain was built to enable scripting of input and further processing of output via pipes. It targets users who work with many API:s using a simple file format. It uses curl, wget or httpie to make the actual calls.

https://github.com/jonaslu/ain

Personal opinion: I don't like GUIs, they are harder to work with. So, any tools that can be replaced should be replaced.

#go
​​Deno + React: No build, no bundle, all streaming

Ultra is a web framework that leans hard into your browser's native features. Embrace the future of ES Modules, Import Maps, and Web Streams. All while supporting some of the non-standards that many normal people love for some reason (JSX and TypeScript).

It's driven by the following hot-takes:
- ESM is non-negotiable in {currentYear}
- SSR is non-negotiable in {currentYear}
- Bundling is an anti-pattern in {currentYear}
- Data can be requested anywhere, and is accessible on the server, always
- Lazy routing with dynamic imports trumps FS routing
- Less magic in tooling and frameworks is a good thing
- Simplify your workflow and tech stack at all costs - life is too short
- Streams are neat

https://github.com/exhibitionist-digital/ultra

Personal opinion: this looks exciting! I am in deno's hypetrain for almost a year now and I love to see new cool use-cases.

#deno #react #js #ts
#rust 1.55 is here.

New features:
- Cargo deduplicates compiler errors
- Faster, more correct float parsing
- std::io::ErrorKind variants updated
- Open range patterns added

https://blog.rust-lang.org/2021/09/09/Rust-1.55.0.html
​​Automatically replaces jQuery for you in legacy codebases.

This CLI automatically finds jQuery methods from existing projects and generate vanilla #js alternatives.

> I've been working on removing jQuery dependency from multiple projects including lightGallery lately. Most of the projects use only 15% to 20% or less than 30% of the jquery methods And in most of the cases, I didn't want to support all the edge cases or legacy browsers. The hardest part was finding the jQuery methods in the existing project and writing the alternative vanilla js methods without making much changes in the codebase. So I wrote this library which automatically finds jquery methods in any particular JavaScript file and generates readable, chainable vanilla js alternatives. This can also be useful if you want to generate your own utility methods similar to jQuery.

https://github.com/sachinchoolur/replace-jquery
​​TODOs you cannot forget!

In the Bad Old Days, if you had a bit of code you knew you needed to change later, you might leave yourself a code comment to remind yourself to change it. For example, here's the real world code comment that inspired this method:

class UsersController < ApiController
# TODO: remember to delete after JS app has propagated
def show
redirect_to root_path
end
end


This was bad. The comment did nothing to remind myself or anyone else to actually delete the code. Because no one was working on this part of the system for a while, the continued existence of the redirect eventually resulted in an actual support incident (long story).

To use it, try replacing one of your TODO comments with something like this:

class UsersController < ApiController
TodoOrDie("delete after JS app has propagated", by: "2019-02-04")
def show
redirect_to root_path
end
end


Nothing will happen at all until February 4th, at which point the gem will raise an error whenever this class is loaded until someone deals with it.

#ruby: https://github.com/searls/todo_or_die
#rust: https://github.com/davidpdrsn/todo-or-die
​​Pyret is a programming language designed to serve as an outstanding choice for programming education while exploring the confluence of scripting and functional programming. It's under active design and development, and free to use or modify.

Features:
- Pyret has Python-inspired syntax for functions, lists, and operators
- Pyret makes testing a natural part of the programming process. Functions can end in a where: clause that holds unit tests for the function
- Pyret allows for concise, expressive, recursive data declarations. Type annotations are optional and can be added incrementally, to serve a variety of pedagogic styles and curricular needs
- In addition to where: blocks, which are attached to individual definitions (and hence usually contain unit tests), you can also write check: blocks at the top level, for general program testing

https://www.pyret.org/index.html

#js
​​Miller is like awk, sed, cut, join, and sort for name-indexed data such as CSV, TSV, and tabular JSON.

With Miller, you get to use named fields without needing to count positional indices, using familiar formats such as CSV, TSV, JSON, and positionally-indexed. Then, on the fly, you can add new fields which are functions of existing fields, drop fields, sort, aggregate statistically, pretty-print, and more.

1. Miller operates on key-value-pair data while the familiar Unix tools operate on integer-indexed fields: if the natural data structure for the latter is the array, then Miller's natural data structure is the insertion-ordered hash map.
2. Miller handles a variety of data formats, including but not limited to the familiar CSV, TSV, and JSON. (Miller can handle positionally-indexed data too!)

https://github.com/johnkerl/miller

#c #go #shell
​​Like jq, but for HTML. Uses CSS selectors to extract bits of content from HTML files.

https://github.com/mgdm/htmlq

#rust
​​Bash command line framework and CLI generator. Create feature-rich bash scripts using simple YAML configuration.

Bashly is a command line application (written in Ruby) that lets you generate feature-rich bash command line tools.

Bashly lets you focus on your specific code, without worrying about command line argument parsing, usage texts, error messages and other functions that are usually handled by a framework in any other programming language.

https://github.com/DannyBen/bashly

#ruby #shell
​​KDL is a document language with xml-like semantics that looks like you're invoking a bunch of CLI commands! It's meant to be used both as a serialization format and a configuration language, much like JSON, YAML, or XML.

Features:
- Node-based, you won't have to mess with identation to make it work
- Type annotations
- Implementations in different languages: #python, #elixir, #rust, #java, #js, #ruby, #php, etc

https://kdl.dev/
​​Automatically upgrade your Django projects.

django-upgrade is a commandline tool that rewrites files in place. Pass your Django version as <major>.<minor> to the --target-version flag and the fixers will rewrite code to avoid DeprecationWarnings on that version of Django. For example: django-upgrade --target-version 3.2 example/core/models.py example/settings.py

Features:
- Compatibility imports
- url() to path() migration
- HttpRequest.headers
- QuerySetPaginator
- Better tests
- And many others!

https://github.com/adamchainz/django-upgrade
​​Flowistry is a VSCode extension that helps you understand #rust programs with program analysis.

Flowistry uses dataflow analysis and pointer analysis to analyze Rust programs at a deeper level than just types can offer (e.g. as you can already find in rust-analyzer).

Flowistry has five commands:
- Flowistry: Backward Highlight: given a selected variable, this command highlights the backward slice of the variable.
- Flowistry: Backward Select: same as above, but this puts the slice in your selection rather than highlighting it.
- Flowistry: Forward Highlight and Flowistry: Forward Select: same as above, but for forward slices than backward slices.
- Flowistry: Effects: given your cursor is within a particular function, this command opens the effects panel for that function.

https://github.com/willcrichton/flowistry
​​Resource monitor that shows usage and stats for processor, memory, disks, network and processes.

C++ version and continuation of bashtop and bpytop.

Features:
- Easy to use, with a game inspired menu system.
- Full mouse support, all buttons with a highlighted key is clickable and mouse scroll works in process list and menu boxes.
- Fast and responsive UI with UP, DOWN keys process selection.
- Function for showing detailed stats for selected process.
- Ability to filter processes.
- Easy switching between sorting options.
- Tree view of processes.
- Send any signal to selected process.
- UI menu for changing all config file options.
- Auto scaling graph for network usage.
- Shows IO activity and speeds for disks
- Battery meter
- Selectable symbols for the graphs
- Custom presets

https://github.com/aristocratos/btop
👍1
​​Seed is a #rust front-end framework for creating fast and reliable web apps with an Elm-like architecture.

Seed allows you to develop the front-end with all the benefits of Rust, meaning speed, safety, and too many more things to count.

The Seed templating system uses a macro syntax that makes Rustaceans feel right at home. This means linting, formatting, and commenting will work, and it's all in Rust. This is opposed to a JSX-like syntax that relies on IDE extensions to improve the developer experience.

Seed has a batteries-included approach. This means less time writing boilerplate and less time installing dependencies.

Features
- completely written in Rust, including the templating system (e.g. div! macro).
- built-in state management that is based on the Elm architecture.
- a batteries-included approach with a focus on developer experience.
- clear and extensive documentation for Rust beginners and pros alike.
- WebAssembly.

https://github.com/seed-rs/seed
​​Astro is a fresh but familiar approach to building websites. Astro combines decades of proven performance best practices with the DX improvements of the component-oriented era. Use your favorite JavaScript framework and automatically ship the bare-minimum amount of JavaScript—by default.

Most of the JS based JAMStack solutions you know do let you produce optimized, pre-generated HTML files, but as they're usually based on a UI framework, there's a core JS Framework runtime - React for Gatsby, Vue for Gridsome, Angular for Scully, that always ships! It's part of the core experience and is expected to be always needed. Even if you have pages that might not need any interactivity or behavioral code, the runtime gets downloaded and interpreted. It's a precious time wasted, on a non-essential job, from a static page perspective.

So, why do we prefer a #js based SSG solution in the first place?

- Mostly probably because of one of the following reasons -
- Hand-crafting is hard
- Interactivity is almost always required (or we think it is)
- Familiarity with a UI Framework is a top priority
- A familiar tooling, DX, quick/instant feedback loop go a long way, in making tech X a better choice than tech Y
- A rich ecosystem, CMS integrations(like Gatsby) greatly simplify the content authoring pipeline
- The JS/Non-JS tools you knew are wickedly fast, but only produce static HTML (Eleventy, Hugo, etc.) by default. You manage browser-side behaviour the conventional way.

Wouldn't it be good if you can still build SSG sites, without giving up on many of the above benefits(except the ecosystem probably for now) - interactivity, tooling, familiar UI framework, DX, while being more mindful towards the site, and every page served?. No/Less JS by default, and all the client-side JS, loaded precisely when necessary - with the framework itself exposing constructs to orchestrate the JS load and initialization behavior in a fine-tuned way.

If you like how this sounds, Astro is for you!

https://github.com/snowpackjs/astro
​​cheat allows you to create and view interactive cheatsheets on the command-line. It was designed to help remind unix system administrators of options for commands that they use frequently, but not frequently enough to remember.

https://github.com/cheat/cheat

#go #shell
⚡️Breaking news!

PostgreSQL 14 Released!

PostgreSQL 14 brings a variety of features that help developers and administrators deploy their data-backed applications. PostgreSQL continues to add innovations on complex data types, including more convenient access for JSON and support for noncontiguous ranges of data. This latest release adds to PostgreSQL's trend on improving high performance and distributed data workloads, with advances in connection concurrency, high-write workloads, query parallelism and logical replication.

Features:
- JSON Conveniences and Multiranges: SELECT ('{ "postgres": { "release": 14 }}'::jsonb)['postgres']['release']; now works.
- Performance Improvements for Heavy Workloads
- Enhancements for Distributed Workloads
- Administration and Observability
- SQL Performance, Conformance, and Convenience

https://www.postgresql.org/about/news/postgresql-14-released-2318/
​​Interactive Redis: A Terminal Client for Redis with AutoCompletion and Syntax Highlighting.

IRedis is a terminal client for redis with auto-completion and syntax highlighting. IRedis lets you type Redis commands smoothly, and displays results in a user-friendly format.

IRedis is an alternative for redis-cli. In most cases, IRedis behaves exactly the same as redis-cli. Besides, it is safer to use IRedis on production servers than redis-cli: IRedis will prevent accidentally running dangerous commands, like KEYS *

Has many other awesome features!

https://github.com/laixintao/iredis

#python