40 Matching Annotations
  1. Aug 2023
    1. async is a concurrency technique. If you need concurrency, async is required for node to work properly (not "better"). If you don't have concurrency, you don't need async. The point is you need to actually understand what async does for you and why. It's not inherently "better" for no reason and you don't need to memorize it as a "best practice". If the OP is writing a command line utility to alter a JSON file then exit, async complicates the code for no reason as the concurrency is not required.
  2. Jan 2023
    1. I've worked with and have helped maintain paranoia for a while. I'm convinced it does the wrong thing for most cases. Paranoia and acts_as_paranoid both attempt to emulate deletes by setting a column and adding a default scope on the model. This requires some ActiveRecord hackery, and leads to some surprising and awkward behaviour.
    1. The solution is pretty simple. In the MaterialsController just show all the materials that do not have a :deleted_at column set. In the MaterialsTrashController just show only the Materials with :delete_at controller. I can solve the whole problem with one simple filter that would take me like 1 minute to implement. We don’t need any of the problems above. They simply will not exist.
  3. Dec 2022
    1. Projects like Kompose or Okteto Stacks show how the simpler Compose model can be translated into Kubernetes API payloads
  4. Apr 2022
  5. Mar 2022
  6. Oct 2021
  7. Sep 2021
  8. Jul 2021
  9. Jun 2021
  10. Apr 2021
    1. There's nothing to stop you from doing initializer code in a file that lives in app/models. for example class MyClass def self.run_me_when_the_class_is_loaded end end MyClass.run_me_when_the_class_is_loaded MyClass.run_me... will run when the class is loaded .... which is what we want, right? Not sure if its the Rails way.... but its extremely straightforward, and does not depend on the shifting winds of Rails.

      does not depend on the shifting winds of Rails.

  11. Mar 2021
    1. I don't use remote editing much so vim-dirvish is powerful enough to manage my workflow (It's actually faster than netrw ~ the author claims 2x, I feel it's faster than that - it's really instantaneous ⚡) very useful on large codebase/repositories
    2. I was searching for a solution to this problem too since I actually removed netrw from being loaded in vim completely and replace it with vim-dirvish. This plugin has around 500~ LOC, compared to netrw's (11,000+ LOC).
    1. Maybe it would be simple to always add that line, and always shift the source maps by 1.
    2. This semi-colon is added to prevent changing the code behaviour (the famous line ending with parentheses, etc) Most people will use a JS minifier If they don't, a single extra character is unlikely to change much If I'm right about all the above: Why don't we simply always add a semi-colon regardless of what the file ends with?
  12. Feb 2021
    1. but if you were previously using regexp or proc values, they won't work at all with Sprockets 4, and if you try you'll get an exception raised that looks like NoMethodError: undefined method 'start_with?'
    1. I find reform's implementation a bit too complicated too (lots of layers of abstraction, including going through the representable gem for a lot of things)
    2. If you compare the code of Reform and the code of ActiveForm-Rails, I think the last is more simple and clear for a behavior similar (or better).
    3. Finally, I really do something simple and I find the reform's implementation is a little bit too complicated for what I want. I think my code (and yours) is simple.
  13. Jan 2021
  14. Dec 2020
    1. Less developer maintenance burden: The existing (Kuma) platform is complex and hard to maintain. Adding new features is very difficult. The update will vastly simplify the platform code — we estimate that we can remove a significant chunk of the existing codebase, meaning easier maintenance and contributions.
  15. Nov 2020
    1. However, this coalescing was very complicated, both in the specification and implementations, due to the dynamism of computed property names for accessors. Coalescing was a big source of overhead (e.g., in terms of code size) in polyfill implementations of "Stage 2" decorators.
  16. Jun 2020
  17. Apr 2020
    1. minitest doesn't reinvent anything that ruby already provides, like: classes, modules, inheritance, methods. This means you only have to learn ruby to use minitest and all of your regular OO practices like extract-method refactorings still apply.
    1. Don't use it! Writing simple assertions (and Minitest way of transforming them to expectations) is almost always a better idea anyway. Work with your favourite library authors to start with assertions and add matchers for convenience and not the other way around. Keep it simple.
  18. Mar 2020
    1. GNU gettext is designed to minimize the impact of internationalization on program sources, keeping this impact as small and hardly noticeable as possible. Internationalization has better chances of succeeding if it is very light weighted, or at least, appear to be so, when looking at program sources.
  19. Dec 2019
    1. So many power users try dozens of complicated todo list software applications, only to go right back to their trusty todo.txt file.

      How true. I've found that to be true as well.

    1. I've always thought that the Gentoo way of installing a new system (from backup or otherwise) was the best due to its simplicity.
    1. There are many options for performing backups. Most Linux distributions are provided with one or more open source programs specially designed to perform backups. There are many commercial options available as well. But none of those directly met my needs so I decided to use basic Linux tools to do the job.