Bookmarks

Bookmarks

50534 bookmarks
Custom sorting
The best way to get NVM working in CI/CD systems
The best way to get NVM working in CI/CD systems
TL;DR While reasoning is important, readers may not be interested in all the frustrations I experienced while figuring out how to get things done. If you’re looking for a quick solution, skip to the “What eventually worked?” section. However, if you’re interested in the thought process behind the solution, keep reading. Why? Some might bother why the hell I’d like to make my life so hard? 🤣 I’m suporting organisation with thousands of projects.
·gagor.pl·
The best way to get NVM working in CI/CD systems
Home | Pagy
Home | Pagy
Gem Version ruby Build Status Coverage Rubocop Status MIT license CII Best Practices Commits Downloads
·ddnexus.github.io·
Home | Pagy
Need for Speed: Using RuboCop with Prism
Need for Speed: Using RuboCop with Prism
By now probably most Rubists have heard of Prism (formerly know as YARP), the modern and (very) fast Ruby parser that’s aiming to replace all the existing Ruby parsers out there. Including RuboCop’s “own” parser (a.k.a whitequark/parser), which aimed to replace ripper and ruby_parser, back when it was created. I’ve been keeping an eye on Prism for while, as RuboCop has long been criticized for its choice of parser (and more specifically - for that parser being somewhat slow). That being said - parser migrations are always a pain, especially in a project as big as RuboCop. Early on I had to essentially rewrite RuboCop when I switched the codebase from ripper to parser, and back then RuboCop was a lot smaller. The good thing is that such rewrites can be done incrementally (I was migrating cops in batches), but it was still a lot of (boring, repetitive) work. That’s why I was super happy when I recently discovered parser-prism - a gem that provides a new backend for the parser gem’s syntax tree that uses the Prism parser. To make things better - it seemed that this library actually worked with RuboCop already. Yeah, the users still had to do some manual work, but it turned out that the migration could be a lot simpler than what I had expected. Did I also mention some mighty impressive benchmarks? As a whole, this parser should be significantly faster than the parser gem. The bin/bench script in this repository compares the performance of Parser::CurrentRuby and Parser::Prism. Running against a large file like lib/parser/prism/compiler.rb yields: Warming up -------------------------------------- Parser::CurrentRuby 1.000 i/100ms Parser::Prism 6.000 i/100ms Calculating ------------------------------------- Parser::CurrentRuby 16.642 (± 0.0%) i/s - 84.000 in 5.052021s Parser::Prism 64.951 (± 3.1%) i/s - 330.000 in 5.088147s Comparison: Parser::Prism: 65.0 i/s Parser::CurrentRuby: 16.6 i/s - 3.90x slower When running with --yjit, the comparison is even more stark: Warming up -------------------------------------- Parser::CurrentRuby 1.000 i/100ms Parser::Prism 9.000 i/100ms Calculating ------------------------------------- Parser::CurrentRuby 20.062 (± 0.0%) i/s - 101.000 in 5.034389s Parser::Prism 112.823 (± 9.7%) i/s - 558.000 in 5.009460s Comparison: Parser::Prism: 112.8 i/s Parser::CurrentRuby: 20.1 i/s - 5.62x slower These benchmarks were run on a single laptop without a lot of control for other processes, so take them with a grain of salt. Note: The results above were taken straight from parser-prism’s README. In a nutshell we’re looking into something like 4-6 times speedup!!! Now I was VERY excited! Immediately I created an issue to improve the support for Prism in RuboCop and we’ve started to collaborate with Prism’s author Kevin Newton, who has been very supportive and accommodating. I suggest to everyone interested in the topic to peruse the discussion in this issue (and issues references from it), as we’ve already managed to simplify the usage of RuboCop with Prism quite a bit. And we’re very close to addressing the main outstanding item - multi-versioning for the parser. Basically, the parser gem allows you to select the version of Ruby to parse code as (e.g. 3.1), independently from the version of Ruby runtime. This powers the TargetRubyVersion configuration option in RuboCop and was one of the many reasons for picking parser over ripper back in the day. In practical terms - this allowed us to keep supporting parsing Ruby 2.x code, long after one couldn’t run RuboCop on Ruby 2.x. To put it in different terms - the versions of Ruby that RuboCop understands (can parse) are completely orthogonal to the versions of Ruby on which RuboCop can be run. This and other items we need to address, are nicely summarized here. None of them seems like a particularly hard obstacle, so I’m quite optimistic about the future. A future in which one day you’ll be able to have this in your RuboCop config: ParserEngine: prism When is this going to happen exactly? No promises yet, but at the current pace it will likely happen sooner rather than later. I’d encourage adventurous people to play with RuboCop on Prism and to contribute to getting all required pieces in place faster. I recall that RuboCop’s adoption of whitequar/parser was instrumental in uncovering (many) weird bugs in it, and I have a feeling that things might be the same for parser-prism as well. (I assume a lot less projects use parser-prism compared to Prism) Exciting times ahead! That’s all I have for you today! Keep hacking!
·metaredux.com·
Need for Speed: Using RuboCop with Prism
A decent VS Code + Ruby on Rails setup
A decent VS Code + Ruby on Rails setup
Setting up VS Code for Ruby on Rails development can be tricky, so I wrote this article to help. In it, I share different VS Code extensions for things like autocomplete, linting, formatting and more! I've even put together a handy extension pack to get you setup fast.
·railsnotes.xyz·
A decent VS Code + Ruby on Rails setup
100 things you can do on your personal website | James' Coffee Blog
100 things you can do on your personal website | James' Coffee Blog
One of my favourite things to do in my free time is to tinker with this website. Indeed, this website is the culmination of years of tinkering. I have added features like coffee shop maps that I can share with friends, a way for me to share my bio in two languages, a sitemap.xml file to help search engines find pages on my website, and more.
·jamesg.blog·
100 things you can do on your personal website | James' Coffee Blog
How To Center a Div
How To Center a Div
Back in the day, centering an element was one of the trickiest things in CSS. As the language has evolved, we’ve been given lots of new tools we can use… But how do we pick the best option? When do we use Flexbox, or CSS Grid, or something else? Let's dig into it.
·joshwcomeau.com·
How To Center a Div
pgexporter | pgexporter
pgexporter | pgexporter
Documentation website for pgexporter
·pgexporter.github.io·
pgexporter | pgexporter
Last Updated Columns With Postgres
Last Updated Columns With Postgres
In many applications it’s a requirement to keep track of when a record was created and updated the last time. Often, this is implemented by having columns such as created_at and updated_at within each table. To make things as simple as possible for application developers, the database itself should take care of maintaining these values automatically when a record gets inserted or updated.
·morling.dev·
Last Updated Columns With Postgres
Falsehoods Junior Developers believe about becoming Senior
Falsehoods Junior Developers believe about becoming Senior
These are mostly my thoughts about what I was expecting as a junior and how I perceived senior developers. To be honest, I was romanticizing them quite a
·vadimkravcenko.com·
Falsehoods Junior Developers believe about becoming Senior
Reduce, recycle, reuse
Reduce, recycle, reuse
McDonald’s reusable workflows — the continuous integration process with GitHub actions.
·medium.com·
Reduce, recycle, reuse
1.5+ million PDFs in 25 minutes - Zerodha Tech Blog
1.5+ million PDFs in 25 minutes - Zerodha Tech Blog
How we generate, digitally sign, and e-mail out 1.5+ million PDFs, as mandated by regulations, in about 25 minutes with a fully self-hosted distributed architecture.
·zerodha.tech·
1.5+ million PDFs in 25 minutes - Zerodha Tech Blog
Scaling ChatGPT: Five Real-World Engineering Challenges
Scaling ChatGPT: Five Real-World Engineering Challenges
Just one year after its launch, ChatGPT had more than 100M weekly users. In order to meet this explosive demand, the team at OpenAI had to overcome several scaling challenges. An exclusive deepdive.
·newsletter.pragmaticengineer.com·
Scaling ChatGPT: Five Real-World Engineering Challenges
Your style, our editor
Your style, our editor
A syntax-aware linter for prose built with speed and extensibility in mind.
·vale.sh·
Your style, our editor
Fuego | Fuego
Fuego | Fuego
The framework for busy Go developers
·go-fuego.github.io·
Fuego | Fuego