40 Matching Annotations
  1. Feb 2024
    1. if (( ${#} == 0 )) ; then while read -r __my_function ; do my_function "${__my_function}" done else target_utility "${@}" fi

      I like it pretty well, in many ways more than G-Man's answer. I like the use of while read. I'd probably prefer non-recursive solution most of the time though, esp. if instead of a function we would be spawning a subshell (script) to achieve the recursion, like in ...

    2. This answer is one of various possible solutions for a "Bash function that accepts input from parameter or pipe" since the OP indicated [in a comment] that base64 was not the actual problem domain. As such, it makes no attempt to assure input is able to be directly read from a file.
    3. The title of the question is what triggered the process of finding this Q/A for material that aided development of the above to solve a real life problem described by the title. The OP declared that base64 decode was not the "real" problem; pedantic constraint of answers to a particular "example" seems less helpful. When this question and its answers were key to helping solve real problems, alternate answers can be gifts to the community in recognition of the fact that many more people will use this Q/A to solve problems. Since the answer is on-topic per the title, I feel it is "game on".
  2. Jan 2024
    1. Issue relations are meant to be the basic infrastructure to build on (at least that is how I meant it when I posted the original feature request). Just like the labels are just a binary relation between a issue and a "label", the relations should be just a ternary relation between two issues and a "label". Then you can build issue task lists on top of the relations like you've built issue boards on top of the labels.
  3. Apr 2022
    1. This would work if your transaction only wraps a single model's save operation. I need to wrap at least Node + Version + Attachment

      looking for a callback that you can register to happen after current transaction is committed, not just after_commit of model -- though actually, that might fire precisely when current transaction is committed, too (except that it might only get triggered for nested transactions, not the top-most transaction), so it could maybe go there ... but I think the problem is just that it doesn't belong there, because it's not specific to the model...

      I guess the OP said it best:

      I am not looking for model based after commits on update/create/etc, I want to be able to dynamically define a block that will be executed only if the current (top-most) transaction passes:

  4. Jan 2022
  5. Sep 2021
  6. Aug 2021
  7. Jul 2021
  8. Mar 2021
  9. Feb 2021
    1. So, the sad conclusion is: all problems must be resolved individually depending on a specific usage context. There’s no silver bullet to resolve all ZeroDivisionErrors once and for all. And again, I am not even covering complex IO flows with retry policies and expotential timeouts.
  10. Jan 2021
  11. Oct 2020
  12. Sep 2020
  13. Apr 2020
  14. Jan 2020