16 Matching Annotations
- Feb 2024
-
unix.stackexchange.com unix.stackexchange.com
-
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".
-
- Jan 2024
-
gitlab.com gitlab.com
-
Board view Subtasks are shown slightly indented from the main task Subtasks can be dragged out of the parent task to a new list to indicate their status. For subtasks with a different status to their parent, it displays a dummy parent (ghosted), above the subtask in the list, with the parent's status label visible against the dummy. Dragging the parent task to a different list changes the label of the child tasks as well, and any sub tasks already in its new list are re-organised under the parent and any dummy removed
-
- Jul 2022
-
stackoverflow.com stackoverflow.com
-
A more conservative workaround is find the gems that are causing issues and list them on the top of your Gemfile.
good solution ... except that it didn't help/work
-
-
discuss.rubyonrails.org discuss.rubyonrails.org
-
Overriding the ActiveStorage controllers to add authentication or customize behavior is a bit tedious because it requires either: using custom routes, which means losing the nice url helpers provided by active storage copy pasting the routes in the application routes.rb, which is not very DRY.
-
- Jan 2022
-
-
Boilerplate is only boilerplate if it's the same everywhere, which it shouldn't be.
-
- Apr 2021
-
stackoverflow.com stackoverflow.com
-
class AuthConstraint def initialize(&block) @block = block || ->(_) { true } end def matches?(req) user = current_user(req) user.present? && @block.call(user) end def current_user(req) User.find_by_id(session[:user_id]) end end This is a flexible approach to defining route access based on any desired variable (roles, auth, etc...)
Good solution, and might be needed if you want to base routes on roles, etc. — but this one is even easier if all you need is for it to be conditional based on signed in or not (because devise provides authenticated helper):
-
- Mar 2021
-
askubuntu.com askubuntu.com
-
This is the only answer that does not require manually parsing the .desktop file, so it's the most sane (and safe) approach.
-
-
www.chevtek.io www.chevtek.io
-
Write modules that do one thing well. Write a new module rather than complicate an old one.
.
-
- Feb 2021
-
github.com github.com
-
For this one we'll define a helper method to handle raising the correct errors. We have to do this because calling .run! would raise an ActiveInteraction::InvalidInteractionError instead of an ActiveRecord::RecordNotFound. That means Rails would render a 500 instead of a 404.
True, but why couldn't it handle this for us?
-
-
-
It makes me happy to see people actually think about things and not just accept a shitty API.
Tags
- can we do even better?
- don't settle for/accept something that's not as good as it can be
- less than ideal / not optimal
- actually consider / think about how it _should_ (ideally) be
- doing something without knowing why/how it works
- intentional/well-considered decisions
- describe the ideal hypothetical solution
- "makes me happy when ..."
Annotators
URL
-
-
-
I typically save everything I can first, and then call the side-effects afterwards. If the side-effects fail I can handle them elsewhere and retry when necessary.
-
- Oct 2020
-
medium.com medium.com
-
Examples of this include: requiring base classes or reading from imported variables that have not been initialized yet.
-
as soon as you have a (indirect) circular dependency, you might be interacting with a half loaded module in your code.
-
-
svelte.dev svelte.dev
-
Just like elements can have children... <div> <p>I'm a child of the div</p> </div>...so can components. Before a component can accept children, though, it needs to know where to put them. We do this with the <slot> element.
-
-
humanwhocodes.com humanwhocodes.com
-
Once again, this isn’t good or bad, it’s just the most efficient way to create something that is similar to something else
-
- May 2020
-
ico.org.uk ico.org.ukHome1