- Mar 2021
-
trailblazer.to trailblazer.to
-
With all this “monetization” happening around Trailblazer, we will also make sure that all free and paid parts of the project grow adult and maintan an LTS - or long-term support - status. Those are good news to all you users out there having been scared to use gems of this project, not knowing whether or not they’re being maintained, breaking code in the future or making your developers addicted to and then cutting off the supply chain. Trailblazer 2.1 onwards is LTS, and the last 1 ½ years of collaboration have proven that.
-
-
www.youtube.com www.youtube.com
-
seems a interesting talk on k8s
听了一半,这里的 Builders and Operators 指的是运维而非 k8s controller 里的 operator,以后有机会再看看吧
配合自己用 kubeadm 部署一个 cluster 可能不错
-
-
sandradodd.com sandradodd.com
-
It means "You're about to talk about words, but words don't matter."
-
-
vitalik.ca vitalik.ca
Tags
Annotators
URL
-
-
stackoverflow.com stackoverflow.com
-
If you want to compile youself you can pass the --with-features=huge to the configure script. Note, however, this does not enable the different language bindings because those are mostly optional and also the various GUIs need to enabled specifically, because you can have only one gui.
This explains why the standard vim package on ubuntu doesn't have GUI support (I was going to say because it wouldn't know which GUI you needed, but I think it would based on the Ubuntu variant: GNOME, KDE, etc.) (maybe because it wouldn't know whether you wanted GUI support at all)
I was going to say because it wouldn't know which GUI you needed, but I think it would based on the Ubuntu variant: GNOME, KDE, etc.
found answer to that: https://hyp.is/NyJRxIgqEeuNmWuaScborw/askubuntu.com/questions/345593/how-to-build-vim-with-gui-option-from-sources
so you have to install a different package with GUI support, like vim-gtk or vim-athena
-
-
gitlab.gnome.org gitlab.gnome.org
-
When one is searching for it on the internet, there are many many people wondering how one can open .desktop files. It seems trivial, since one usually just has to click an item on the launcher so one thinks there must be some way.
-
It sounds like a gnome-open (or the equivalent library call) bug. Reassigning.
-
I agree that it's bad to have to handle this at the application level
-
-
news.sky.com news.sky.com
-
COVID-19 vaccine rollout may be delayed—With IT system ‘failing constantly’. (n.d.). Sky News. Retrieved 2 March 2021, from https://news.sky.com/story/covid-19-vaccine-rollout-may-be-delayed-with-it-system-failing-constantly-12164829
-
-
medium.com medium.com
-
Very often in these monorepos, packages are so incredibly specific in functionality, the question then becomes why even have a separate package at all if it’s tightly coupled? Can you use these packages independently or are they tied to specific versions of other packages in the monorepo? It’ll probably be easier to remove the mask and just work as a monolith.
-
-
blog.izs.me blog.izs.me
-
Focus is better than features.
-
-
www.chevtek.io www.chevtek.io
-
he goes on to say that simple functions should not be packages because they are too small.
-
Write modules for publication, even if you only use them privately. You will appreciate documentation in the future.
-
Write modules that do one thing well. Write a new module rather than complicate an old one.
.
Tags
- avoid complexity
- for the benefit of future self
- micropackages
- can it really ever be too _?
- do one thing and do it well
- write/document it as if it will be published even if only will use privately/internally (for the benefit of future self) (maintain rigor without shortcuts)
- good policy/practice/procedure
- prefer simpler option
- simple solution
Annotators
URL
-
-
tobeagile.com tobeagile.com
-
The number one problem that I see developers have when practicing test-first development that impedes them from refactoring their code is that they over-specify behavior in their tests. This leads developers to write more tests than are needed, which can become a burden when refactoring code.
-
-
en.wikipedia.org en.wikipedia.orgPyPy1
-
There used to be other backends in addition to C: Java, CSharp, and Javascript but those suffered from bitrot and have been removed.
-
-
en.wikipedia.org en.wikipedia.org
-
much software requires continuous changes to meet new requirements and correct bugs, and re-engineering software each time a change is made is rarely practical.
-
-
www.inuse.se www.inuse.se
-
A product’s onceability is, to a certain extent, linked to its usefulness. If it is really useful, we will certainly go to considerable lengths to repair it.
-
-
github.com github.com
-
This is a copy of the "AMD" document in the repo, kept here to maintain historical links. If this document differs from the one in the repo, the repo version is the correct one.
Why not just make this document empty (besides a link) and link/redirect to the canonical version?
That way it is impossible for them to disagree.
Tags
- avoid duplication: impossible for them to disagree/diverge if there's only one version/copy
- I have a question about this
- canonical version
- make it impossible to get wrong/incorrect
- avoid duplication
- maintaining redirect/copy at old URL in order to maintain historical links (broken links)
Annotators
URL
-
-
github.com github.comd3/d32
-
Microlibraries are easier to understand, develop and test. They make it easier for new people to get involved and contribute. They reduce the distinction between a “core module” and a “plugin”, and increase the pace of development in D3 features.
-
Small files are nice, but modularity is also about making D3 more fun.
-
-
github.com github.com
-
Unfortunately, given how widely used concat_javascript_sources is, this required changing a lot of tests. It would be nice if we could remove some of the duplication in these tests (so that similar changes would not require updating this many tests), but that can come in another PR.
-
-
github.com github.com
-
I don't understand why this isn't being considered a bigger deal by maintainrs/the community. Don't most Rails developers use SCSS? It's included by default in a new Rails app. Along with sprockets 4. I am mystified how anyone is managing to debug CSS in Rails at all these days, that this issue is being ignored makes sprockets seem like abandonware to me, or makes me wonder if nobody else is using sprockets 4, or what!
-
Meh... as I said earlier, I think using Webpack is the recommended way now. Another issue is there is no way to generate source maps in production.
-
sprockets 4 makes Chrome browser identification of SCSS css lines _worse_
-
But maybe few are still using sprockets at all, for JS or (S)CSS anymore? Hard to say.
-
If I can't do something to change the sprockets 4 debugging experience I am seeing, I am going to probably downgrade back to sprockets 3. I am finding it impossible to develop CSS the ways I am used to.
-
Is there a PR to... something? sassc-rails? That would make the patch not necessary? (I don't know if there's any good way to monkey-patch that in, I think you have to fork? So some change seems required...) Should the defaults be different somehow? This is very difficult to figure out.
-
Is there a PR to... something? sassc-rails?
Tags
- switching/migrating from Sprockets to Webpack (Rails)
- official preferred convention / way to do something
- annotation meta: may need new tag
- sprockets
- is anyone even still using it anymore?
- made it worse
- hard to figure out where the problem lies / how to solve the problem / where to even begin
- where (which project) do I even report this problem/bug? (whose responsibility is it?)
- possible response/reaction to lack of maintainance / maintainer absence/silence
- why aren't people talking about/asking this?
- why aren't the maintainers more concerned about / fixing this?
Annotators
URL
-
-
github.com github.com
-
I don't even know how to tell if they're working 100%, I'm getting mixed signals ..
-
Should it only contain link* calls?
-
When should I use link, vs dir, vs. tree?
-
but I still have no idea if I'm writing this new file correctly.
-
-
-
If the bug is still there I think that it is better if it is open so others can find it if they run into the same issue.
-
Closing this because it's obviously not going to get fixed and it's cluttering my open issues
-
-
github.com github.com
-
If a company really wanted to invest, I would prefer they dedicated an employee for X hours a week for Y months than money.
-
Money could be good if it is spent to provide some of the above things. Money on it's own is hard because then it means I would have to spend time book-keeping and managing instead of programming.
-
-
-
Any updates on this one? It makes debugging JS and CSS in the web inspector next to impossible when you can't get any help finding the offending code in your own source files.
-
-
math.stackexchange.com math.stackexchange.com
-
An equation is meant to be solved, that is, there are some unknowns. A formula is meant to be evaluated, that is, you replace all variables in it with values and get the value of the formula.
-
-
existek.com existek.com
-
Want to know how to build a taxi app that will become the next Uber or Carb? It is a reasonable question considering how convenient and cost-effective it is to use a taxi instead of maintaining your own vehicle. The best way for a cab company to ensure this convenience for customers is to build a taxi booking app.
-
-
stackoverflow.com stackoverflow.com
-
Usually when people are talking about code being semantically correct, they're referring to the code that accurately describes something.
-
Semantically correct usage of elements means that you use them for what they are meant to be used for.
-
It means that you're calling something what it actually is.
-
-
css-tricks.com css-tricks.com
-
always use real <label for="correct_input"> elements. Just that alone is a UX consideration all too many forms fail on
-
-
stackoverflow.com stackoverflow.com
-
This question was asked over a year ago, but it's a good question that I recently encountered as well...
-
-
-
The HTML5 form validation techniques in this post only work on the front end. Someone could turn off JavaScript and still submit jank data to a form with the tightest JS form validation.To be clear, you should still do validation on the server.
-
-
www.html5rocks.com www.html5rocks.com
-
Therefore client side validation should always be treated as a progressive enhancement to the user experience; all forms should be usable even if client side validation is not present.
-
It's important to remember that even with these new APIs client side validation does not remove the need for server side validation. Malicious users can easily workaround any client side constraints, and, HTTP requests don't have to originate from a browser.
-
Since you have to have server side validation anyways, if you simply have your server side code return reasonable error messages and display them to the end user you have a built in fallback for browsers that don't support any form of client side validation.
-
-
stackoverflow.com stackoverflow.com
-
I know this is old, but I got the same error and I came here from Google, so in case someone does too, this was my solution:
-
-
afarkas.github.io afarkas.github.ioWebshim1
-
Webshim is also more than a polyfill, it has become a UI component and widget library. Webshim enables a developer to also enhance HTML5 capable browsers with more highly customizable, extensible and flexible UI components and widgets.
And now that it's deprecated (presumably due to no longer needing these polyfills), not only do the polyfills go away (no longer maintained), but also these unrelated "extras" that some of us may have been depending on are now going away with no replacement ...
If those were in a separate package, then there would have been some chance of the "extras" package being updated to work without the base webshims polyfills.
In particular, I was using
$.webshims.addCustomValidityRule
which adds something that you can't do in plain HTML5 (that I can tell), so it isn't a polyfill...
-
-
stackoverflow.com stackoverflow.com
-
not all answers pass this tests
-
-
jangawolof.org jangawolof.orgPhrases3
-
Ci taatu guy googu la jigéeni Ajoor yi di jaaye sanqal.
C'est sous ce baobab que les femmes originaires du Kayor vendent de la semoule de mil.
ci -- close; at @, in, on, inside, to.
taat+u (taat) wi -- base, bottom, foundation, buttocks.
guy gi -- baobab. 🌴
googu -- that (closeness).
la -- (?).
jigéen+i (jigéen) bi ji -- sister versus brother; woman as opposed to man. 👩🏽
ajoor bi -- person from Kayor.
yi -- the (plural).
di -- be; mark of the imperfective affirmative not inactual.
jaay+e (jaay) v. -- sell.
sanqal si -- millet semolina. 🌾
-
Peñe, kenn du ko able.
Un peigne, personne ne le prête.
peñe bi -- (French) comb.
kenn -- no one.
du -- to be (negative). ➖
ko -- it.
able v. -- to lend.
-
Sëriñ boobu aj na daaw, doomam a ko wuutu léegi.
Ce marabout est décédé l'an dernier, c'est son fils qui le remplace maintenant.
sëriñ bi -- marabout.
boobu -- this.
aj (Arabic: Hajj) v. -- make the pilgrimage to Mecca. 🕋; deceased ☠️ (for a religious personality).
na -- he (?).
daaw n. -- last year. 🗓
doom+am (doom) ji -- child by descent 👶🏽; doll🪆; to have a child.
-
-
trailblazer.to trailblazer.to
-
This is where all our learnings about semantics, outputs, signals and the DSL come together.
-
Hey, that’s is an imaginary complication of our example - please don’t do this with every condition you have in your app.
-
Knowing about the wiring mechanics in Trailblazer is one thing. However, the real fun starts with nesting activities. That’s when the ideas of encapsulation, interfaces and reducing dependencies really come into play.
Tags
- trailblazer-activity
- artificial example
- where it shines / best application
- coming up with hypothetical examples
- extremes
- example: not how you would actually do it (does something wrong/bad/nonideal illustrating but we should overlook it because that's not the one thing the example is trying to illustrate/show us)
- putting it all together (building, learning, ...)
Annotators
URL
-
- Feb 2021
-
steamcommunity.com steamcommunity.com
-
Do you have collaborators who could have generated keys and sold them on their own? DIG's Steam keys and other stores' Steam keys must have some source, after all. Keys don't generate themselves, and only your accounts should be able to request them.This particular game was in Bunch Keys Indie Wizardry Bundle. I assume you had a proper contract for that. Maybe DIG or an intermediary bought 50-200 copies of it?
-
It isn't stealing because you or an associate must have generated and given them the keys in some way or another?Ideally you would ask a DIG bundle buyer to show you their key for your game, so you can figure out what key request batch it came from, and then you can scratch your head and wonder who you gave those keys to and what journey they took afterwards.
-
-
trailblazer.to trailblazer.to
-
For branching out a separate path in an activity, use the Path() macro. It’s a convenient, simple way to declare alternative routes
Seems like this would be a very common need: once you switch to a custom failure track, you want it to stay on that track until the end!!!
The problem is that in a Railway, everything automatically has 2 outputs. But we really only need one (which is exactly what Path gives us). And you end up fighting the defaults when there are the automatic 2 outputs, because you have to remember to explicitly/verbosely redirect all of those outputs or they may end up going somewhere you don't want them to go.
The default behavior of everything going to the next defined step is not helpful for doing that, and in fact is quite frustrating because you don't want unrelated steps to accidentally end up on one of the tasks in your custom failure track.
And you can't use
fail
for custom-track steps becase that breaksmagnetic_to
for some reason.I was finding myself very in need of something like this, and was about to write my own DSL, but then I discovered this. I still think it needs a better DSL than this, but at least they provided a way to do this. Much needed.
For this example, I might write something like this:
step :decide_type, Output(Activity::Left, :credit_card) => Track(:with_credit_card) # Create the track, which would automatically create an implicit End with the same id. Track(:with_credit_card) do step :authorize step :charge end
I guess that's not much different than theirs. Main improvement is it avoids ugly need to specify end_id/end_task.
But that wouldn't actually be enough either in this example, because you would actually want to have a failure track there and a path doesn't have one ... so it sounds like Subprocess and a new self-contained ProcessCreditCard Railway would be the best solution for this particular example... Subprocess is the ultimate in flexibility and gives us all the flexibility we need)
But what if you had a path that you needed to direct to from 2 different tasks' outputs?
Example: I came up with this, but it takes a lot of effort to keep my custom path/track hidden/"isolated" and prevent other tasks from automatically/implicitly going into those steps:
class Example::ValidationErrorTrack < Trailblazer::Activity::Railway step :validate_model, Output(:failure) => Track(:validation_error) step :save, Output(:failure) => Track(:validation_error) # Can't use fail here or the magnetic_to won't work and Track(:validation_error) won't work step :log_validation_error, magnetic_to: :validation_error, Output(:success) => End(:validation_error), Output(:failure) => End(:validation_error) end
puts Trailblazer::Developer.render o Reloading... #<Start/:default> {Trailblazer::Activity::Right} => #<Trailblazer::Activity::TaskBuilder::Task user_proc=validate_model> #<Trailblazer::Activity::TaskBuilder::Task user_proc=validate_model> {Trailblazer::Activity::Left} => #<Trailblazer::Activity::TaskBuilder::Task user_proc=log_validation_error> {Trailblazer::Activity::Right} => #<Trailblazer::Activity::TaskBuilder::Task user_proc=save> #<Trailblazer::Activity::TaskBuilder::Task user_proc=save> {Trailblazer::Activity::Left} => #<Trailblazer::Activity::TaskBuilder::Task user_proc=log_validation_error> {Trailblazer::Activity::Right} => #<End/:success> #<Trailblazer::Activity::TaskBuilder::Task user_proc=log_validation_error> {Trailblazer::Activity::Left} => #<End/:validation_error> {Trailblazer::Activity::Right} => #<End/:validation_error> #<End/:success> #<End/:validation_error> #<End/:failure>
Now attempt to do it with Path... Does the Path() have an ID we can reference? Or maybe we just keep a reference to the object and use it directly in 2 different places?
class Example::ValidationErrorTrack::VPathHelper1 < Trailblazer::Activity::Railway validation_error_path = Path(end_id: "End.validation_error", end_task: End(:validation_error)) do step :log_validation_error end step :validate_model, Output(:failure) => validation_error_path step :save, Output(:failure) => validation_error_path end
o=Example::ValidationErrorTrack::VPathHelper1; puts Trailblazer::Developer.render o Reloading... #<Start/:default> {Trailblazer::Activity::Right} => #<Trailblazer::Activity::TaskBuilder::Task user_proc=validate_model> #<Trailblazer::Activity::TaskBuilder::Task user_proc=validate_model> {Trailblazer::Activity::Left} => #<Trailblazer::Activity::TaskBuilder::Task user_proc=log_validation_error> {Trailblazer::Activity::Right} => #<Trailblazer::Activity::TaskBuilder::Task user_proc=save> #<Trailblazer::Activity::TaskBuilder::Task user_proc=log_validation_error> {Trailblazer::Activity::Right} => #<End/:validation_error> #<Trailblazer::Activity::TaskBuilder::Task user_proc=save> {Trailblazer::Activity::Left} => #<Trailblazer::Activity::TaskBuilder::Task user_proc=log_validation_error> {Trailblazer::Activity::Right} => #<End/:success> #<End/:success> #<End/:validation_error> #<End/:failure>
It's just too bad that:
- there's not a Railway helper in case you want multiple outputs, though we could probably create one pretty easily using Path as our template
- we can't "inline" a separate Railway acitivity (Subprocess "nests" it rather than "inlines")
-
step :direct_debit
I don't think we would/should really want to make this the "success" (Right) path and :credit_card be the "failure" (Left) track.
Maybe it's okay to repurpose Left and Right for something other than failure/success ... but only if we can actually change the default semantic of those signals/outputs. Is that possible? Maybe there's a way to override or delete the default outputs?
Tags
- helper functions
- semantics
- powerful
- example: in order to keep example concise/focused, may not implement all best practices (illustrates one thing only)
- feels wrong
- example: not how you would actually do it (does something wrong/bad/nonideal illustrating but we should overlook it because that's not the one thing the example is trying to illustrate/show us)
- tip
- trailblazer-activity
- useful
- flexibility
- I have a question about this
- concise
- verbose / noisy / too much boilerplate
Annotators
URL
-
-
github.com github.com
-
Personally, I'm starting to think that the feature where it automatically adds xray.js to the document is more trouble than it's worth. I propose that we remove that automatic feature and just make it part of the install instructions that you need to add this line to your template/layout: <%= javascript_include_tag 'xray', nonce: true if Rails.env.development? %>
-
-
github.com github.com
-
Now that I've thought more about it, I honestly think the auto-adding the script feature is overrated, over-complicated, and error-prone (#98, #100), and I propose we just remove it (#110).
-
-
github.com github.com
-
now that I've thought more about it, I think the auto-adding the script feature is overrated, over-complicated, and error-prone (#100), and ought to just be removed (#110).
-
-
github.com github.com
-
now that I realize how easy it is to just manually include this in my app: <%= javascript_include_tag 'xray', nonce: true if Rails.env.development? %> I regret even wasting my time getting it to automatically look for and add a nonce to the auto-injected xray.js script
-
This is failing CI because CI is testing against Rails < 6. I think the appropriate next steps are: Open a separate PR to add Rails 6 to the CI matrix Update this PR to only run CSP-related test code for Rails >= 6.0.0 Can you help with either or both of those?
Tags
- removing features to simplify implementation
- pull requests: can't just throw it over the fence and be done (requires follow-through)
- fix design/API mistakes as early as you can (since it will be more difficult to correct it and make a breaking change later)
- removing legacy/deprecated things
- regret
- removing feature that is more trouble than it's worth (not worth the effort to continue to maintain / fix bugs caused by keeping it)
- wasted effort
Annotators
URL
-
-
forum.wordreference.com forum.wordreference.com
-
At work, we often mention "throwing something over the fence" and "wrong rock" so there is (to us) a proverbial fence and a proverbial wrong rock.
-
-
www.chemistryworld.com www.chemistryworld.com
-
guides.rubyonrails.org guides.rubyonrails.org
-
Keep in mind that third party code with references to other files also processed by the asset Pipeline (images, stylesheets, etc.), will need to be rewritten to use helpers like asset_path.
-
-
en.wikipedia.org en.wikipedia.org
-
found that using only the Pascal-provided control structures, the correct solution was given by only 20% of the subjects, while no subject wrote incorrect code for this problem if allowed to write a return from the middle of a loop.
-
computers theoretically need only one machine instruction (subtract one number from another and branch if the result is negative)
-
-
sobolevn.me sobolevn.me
-
But why do we return 0? Why not 1? Why not None? And while None in most cases is as bad (or even worse) than the exceptions, turns out we should heavily rely on business logic and use-cases of this function.
-
-
github.com github.com
-
Enforces better architecture
-
-
dry-rb.org dry-rb.org
-
In other words, once you've used Maybe you cannot hit nil with a missing method. This is remarkable because even &. doesn't save you from omitting || "No state" at the end of the computation. Basically, that's what they call "Type Safety".
-
-
jrsinclair.com jrsinclair.com
-
Don’t worry if you get confused at first. Everyone does. I’ve listed some other references at the end that may help. But don’t give up.
-
-
fsharpforfunandprofit.com fsharpforfunandprofit.com
-
This is a useful approach to error handling, but please don’t take it to extremes! See my post on “Against Railway-Oriented Programming”.
-
-
trailblazer.to trailblazer.to
-
provide interfaces so you don’t have to think about them
Question to myself: Is not having to think about it actually a good goal to have? Is it at odds with making intentional/well-considered decisions?  Obviously there are still many of interesting decisions to make even when using a framework that provides conventions and standardization and makes some decisions for you...
-
-
trailblazer.to trailblazer.to
-
What this means is: I better refrain from writing a new book and we rather focus on more and better docs.
I'm glad. I didn't like that the book (which is essentially a form of documentation/tutorial) was proprietary.
I think it's better to make documentation and tutorials be community-driven free content
-
The new 2.1 version comes with a few necessary but reasonable changes in method signatures. As painful as that might sound to your Rails-spoiled ears, we preferred to fix design mistakes now before dragging them on forever.
-
The new call API is much more consistent and takes away another thing we kept explaining to new users - an indicator for a flawed API.
-
Also, the more I use Trailblazer in projects or even in Trailblazer itself, I feel how needed those new abstractions are.
Tags
- how did we ever live without it?
- free content
- abstractions
- knowledge commons (information/data/content)
- I'm glad they did it this way
- better late than never
- focus on the user
- pointing out gaps/downsides/cons in competition/alternatives
- if it's incorrect; fix it
- documentation
- welcome/good change
- non-free content
- learn from your mistakes
- I agree
- do it right/well the first time because it may be too hard to clean up/fix later if you don't
- finally / at last
- fix design/API mistakes as early as you can (since it will be more difficult to correct it and make a breaking change later)
- annotation meta: inherit same annotation/tags
- community-driven development
Annotators
URL
-
-
2019.trailblazer.to 2019.trailblazer.to
-
This creates a win-win situation, you as the user have your peace of mind, and we can continue working with your funds.
-
-
github.com github.com
-
While Trailblazer offers you abstraction layers for all aspects of Ruby On Rails, it does not missionize you. Wherever you want, you may fall back to the "Rails Way" with fat models, monolithic controllers, global helpers, etc. This is not a bad thing, but allows you to step-wise introduce Trailblazer's encapsulation in your app without having to rewrite it.
Tags
- allowing developer/user to pick and choose which pieces to use (allowing use with competing libraries; not being too opinionated; not forcing recommended way on you)
- focus on what it should do, not on how it should do it (implementation details; software design)
- rails: the Rails way
- abstractions
- focus on concepts/design/structure instead of specific/concrete technology/implementation
- making changes / switching/migrating gradually/incrementally/step-wise/iteratively
- leaving the details of implementation/integration up to you
- freedom of user to override specific decision of an authority/vendor (software)
- Trailblazer
- newer/better ways of doing things
Annotators
URL
-
-
-
In Ruby 3 we now have a “rightward assignment” operator. This flips the script and lets you write an expression before assigning it to a variable. So instead of x = :y, you can write :y => x
-
-
github.com github.com
-
compose(Add, x: x, y: 3)
How is this better than simply:
Add.run(x: x, y: 3)
?
I guess if we did that we would also have to remember to handle merging errors from that outcome into self...
-
Why is all this interaction code better? Two reasons: One, you can reuse the FindAccount interaction in other places, like your API controller or a Resque task. And two, if you want to change how accounts are found, you only have to change one place.
Pretty weak arguments though...
- We could just as easily used a plain object or module to extract this for easy reuse and having it in only one place (avoiding duplication).
-
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?
Tags
- why is it better?
- library/framework should provide this (standard solution) rather than everyone having to write their own slightly different solution (even if it is easy enough to write yourself)
- software development: code organization: where does this code belong?
- I have a question about this
- active_interaction
- reusability
- good point
- avoid duplication
Annotators
URL
-
-
github.com github.com
-
No one has requested it before so it's certainly not something we're planning to add.
-
I'm sure there will be a few other people out there who eventually want something like this, since Interactions are actually a great fit for enforcing consistency in data structures when working with a schemaless NoSQL store, but obviously it's still a bit of a niche audience.
-
To give a little more context, structures like this often come up in my work when dealing with NoSQL datastores, especially ones that rely heavily on JSON, like Firebase, where a records unique ID isn't part of the record itself, just a key that points to it. I think most Ruby/Rails projects tend towards use cases where these sort of datastores aren't appropriate/necessary, so it makes sense that this wouldn't come up as quickly as other structures.
-
-
github.com github.com
-
I don't think seeing it in Rails PRs naturally means we should do it blankly. Put it another way, what's the justification in those PRs for doing it?
Tags
- understand both sides of an issue
- fallacy: doing something because it's popular / everyone is doing it
- justification for existence
- rationale
- why?
- investing time to really understand something
- understand the trade-offs
- understand the ramifications/effects/consequences
- doing something without knowing why/how it works
Annotators
URL
-
-
github.com github.com
-
The assert method is used by all the other assertions. It pushes the second parameter to the list of errors if the first parameter evaluates to false or nil.
Seems like these helper functions could be just as easily used in ActiveRecord models. Therefore, they should be in a separate gem, or at least module, that can be used in both these objects and ActiveRecord objects.
-
-
davefleet.com davefleet.com
-
From my perspective the onus is on you to consider not just the words coming out of your mouth, but how they are received.
-
-
www.infoworld.com www.infoworld.com
-
Consequently, you act irresponsibly when you adopt any programming practice simply because "that's the way you're supposed to do things."
-
My point is that you should not program blindly. You must understand the havoc a feature or idiom can wreak. In doing so, you're in a much better position to decide whether you should use that feature or idiom. Your choices should be both informed and pragmatic.
-
And just because a feature or idiom is commonly used does not mean you should use it either.
-
-
softwareengineering.stackexchange.com softwareengineering.stackexchange.com
-
The more important point comes from a program design perspective. Here, "programming to an interface" means focusing your design on what the code is doing, not how it does it. This is a vital distinction that pushes your design towards correctness and flexibility.
-
-
-
It makes me happy to see people actually think about things and not just accept a shitty API.
Tags
- intentional/well-considered decisions
- "makes me happy when ..."
- describe the ideal hypothetical solution
- less than ideal / not optimal
- can we do even better?
- don't settle for/accept something that's not as good as it can be
- doing something without knowing why/how it works
- actually consider / think about how it _should_ (ideally) be
Annotators
URL
-
-
-
I do think it's a common pattern that should be solved, and I am probably going to try and solve it as a Gem as opposed to simply writing code that we use in our code base
-
with ActiveForm-Rails, validations is the responsability of the form and not of the models. There is no need to synchronize errors from the form to the models and vice versa.
But if you intend to save to a model after the form validates, then you can't escape the models' validations:
either you check that the models pass their own validations ahead of time (like I want to do, and I think @mattheworiordan was wanting to do), or you have to accept that one of the following outcomes is possible/inevitable if the models' own validations fail:
- if you use
object.save
then it may silently fail to save - if you use
object.save
then it will fail to save and raise an error
Are either of those outcomes acceptable to you? To me, they seem not to be. Hence we must also check for / handle the models' validations. Hence we need a way to aggregate errors from both the form object (context-specific validations) and from the models (unconditional/invariant validations that should always be checked by the model), and present them to the user.
What do you guys find to be the best way to accomplish that?
I am interested to know what best practices you use / still use today after all these years. I keep finding myself running into this same problem/need, which is how I ended up looking for what the current options are for form objects today...
- if you use
-
DSLs can be problematic for the user since the user has to manage state (e.g. am I supposed to call valid? first or update_attributes?). This is exactly why the #validate is the only method to change state in Reform.
-
Trust me, I thought a lot about #validate and its semantics, and I am gonna make it even more "SRP" by making Form#errors and #valid? semi-public. All that happens via #validate reducing the possible wrong usage for users.
-
I apologize for the slow development of Reform after the "explosion" when I released it initially. The reason for this is I changed jobs and didn't use Reform (yet).
Tags
- general solution
- intentional/well-considered decisions
- motivation
- hard to find time/be motivated to build/maintain unless you use it yourself (motivation; maintenance)
- order is important / do things in the right order
- make it hard to get wrong/incorrect
- good point
- overlooking/missing something
- I have a differing opinion
- DSL
- whose responsibility is it?
- have to remember
- common pattern
- making it easy to do the right thing
- sharing/publishing your code so others can use it/benefit too
- reform (Ruby)
- using your project at work
- missing the point
- rails: validation
- single responsibility
- making it easy to do the wrong thing
- state management
Annotators
URL
-
-
-
if you name you instance variable form, then you can always just pass in params[:form]
-
Writing the uniqueness validations yourself is easy so I felt it was better to leave this up to the developer
-
-
cherrycreekschools.instructure.com cherrycreekschools.instructure.com
-
I am wondering the same exact thing.
-
-
www.metacritic.com www.metacritic.com
-
Yes, you do face difficult choices (moral) but you don't care about it. All you care are the reputation bars. So... Let's kill this guy, who cares if he is innocent, but this faction needs it or I'm dead. Sounds great on paper but to be honest... you just sit there and do whatever for these reputation bars. If you won't, then you lose
-
-
hilton.org.uk hilton.org.uk
-
We also find it hard to agree on what good names and bad names look like, which makes it hard to know when renaming improves a name.
-
Naming matters for both idealogical and practical reasons.
-
Anyone who has ever tried to name a child knows that naming is hard. Naming things in code is harder. It’s bad enough that you have to commit to a name that someone isn’t going to like. You also have to be able to live with it.
-
-
www.reddit.com www.reddit.com
-
It's difficult because it's a case-by-case basis - there is no one right answer so it falls into subjective arguments.
-
Space: Suppose we had infinite memory, then cache all the data; but we don't so we have to decide what to cache that is meaningful to have the cache implemented (is a ??K cache size enough for your use case? Should you add more?) - It's the balance with the resources available.
-
Time: Suppose all your data was immutable, then cache all the data indefinitely. But this isn't always to case so you have to figure out what works for the given scenario (A person's mailing address doesn't change often, but their GPS position does).
Tags
- caching
- more than one right way (no one right/best way)
- cache invalidation
- limited resources (computing)
- why is it difficult/hard?
- subjective arguments
- trade-offs
- how good/perfect does it really need to be?
- balance
- how recent/fresh/up-to-date does it need to be? 
- cache invalidation is hard
Annotators
URL
-
-
www.quora.com www.quora.com
-
So the hard and unsolvable problem becomes: how up-to-date do you really need to be?
-
After considering the value we place, and the tradeoffs we make, when it comes to knowing anything of significance, I think it becomes much easier to understand why cache invalidation is one of the hard problems in computer science
the crux of the problem is: trade-offs
-
The non-determinism is why cache invalidation — and that other hard problem, naming things — are uniquely and intractably hard problems in computer science. Computers can perfectly solve deterministic problems. But they can’t predict when to invalidate a cache because, ultimately, we, the humans who design and build computational processes, can’t agree on when a cache needs to be invalidated.
Tags
- where it shines / best application
- deterministic
- main/key/central/essential/core thing/point/problem/meat
- nondeterministic
- good question
- knowledge
- hard things in computer science
- generalized explanation
- good explanation
- trade-offs
- how good/perfect does it really need to be?
- computers
- good point
- cache invalidation is hard
Annotators
URL
-
-
copyheart.org copyheart.org
-
Creating more legally binding licenses and contracts just perpetuates the problem of law – a.k.a. state force – intruding where it doesn’t belong.
-
-
www.honeybadger.io www.honeybadger.io
-
Now if you think about it, PJAX sounds a lot like Turbolinks. They both use JS to fetch server-rendered HTML and put it into the DOM. They both do caching and manage the forward and back buttons. It's almost as if the Rails team took a technique developed elsewhere and just rebranded it.
-
-
www.reddit.com www.reddit.com
-
when it comes to personal machines, I expect them to just work so I can work.
-
-
www.reddit.com www.reddit.com
-
And honestly, most people prefer the no hassle, especially after wasting too much time dabbling with distros that are "for advanced users" troubleshooting all kinds of dumbass problems that just worked out of the box in many other distros.
-
-
jakearchibald.com jakearchibald.com
-
This nav bar by Chris Coyier is a great example of something that makes more sense as a flexbox than grid.
-
Flexbox's strength is in its content-driven model. It doesn't need to know the content up-front. You can distribute items based on their content, allow boxes to wrap which is really handy for responsive design, you can even control the distribution of negative space separately to positive space.
-
-
stackoverflow.com stackoverflow.com
-
that's a point, but I would say the opposite, when entering credit card data I would rathre prefer to be entirely in the Verified By Visa (Paypal) webpage (with the url easily visible in the address bar) rather that entring my credit card data in an iframe of someone's website.
-
-
stackoverflow.com stackoverflow.com
-
If you teach your users to trust that URL bar is supposed to not change when they click links (e.g. your site uses a big iframe with all the actual content), then the users will not notice anything in the future either in case of actual security vulnerability.
-
Your browser window is basically just one big iframe.
-
-
medium.com medium.com
-
The point is, just because you don’t see it, doesn’t mean it’s not happening. It’s been more than two years and as far as I know, no one has ever noticed one of my requests. Maybe it’s been in your site this whole time
-
- Jan 2021
-
www.facebook.com www.facebook.com
-
Group Rules from the Admins1NO POSTING LINKS INSIDE OF POST - FOR ANY REASONWe've seen way too many groups become a glorified classified ad & members don't like that. We don't want the quality of our group negatively impacted because of endless links everywhere. NO LINKS2NO POST FROM FAN PAGES / ARTICLES / VIDEO LINKSOur mission is to cultivate the highest quality content inside the group. If we allowed videos, fan page shares, & outside websites, our group would turn into spam fest. Original written content only3NO SELF PROMOTION, RECRUITING, OR DM SPAMMINGMembers love our group because it's SAFE. We are very strict on banning members who blatantly self promote their product or services in the group OR secretly private message members to recruit them.4NO POSTING OR UPLOADING VIDEOS OF ANY KINDTo protect the quality of our group & prevent members from being solicited products & services - we don't allow any videos because we can't monitor what's being said word for word. Written post only.
Wow, that's strict.
-
-
www.zdnet.com www.zdnet.com
-
Systemd flies in the face of the Unix philosophy: 'do one thing and do it well,' representing a complex collection of dozens of tightly coupled binaries
-
-
blog.linuxmint.com blog.linuxmint.com
-
We informed and documented. We made it easy for you to understand the problem and also to take action if you disagreed. I hope you didn’t read https://linuxmint-user-guide.readthedocs.io/en/latest/snap.html#how-to-install-the-snap-store-in-linux-mint-20. I can’t understand how it could be simpler.
-
Is it harder to enable it in Mint than it is to disable it in Ubuntu? Not at all. Is how to enable it better documented in Mint than how to disable it in Ubuntu? Absolutely: https://linuxmint-user-guide.readthedocs.io/en/latest/snap.html.
-
We don’t do politics, and we certainly don’t do religion. You’re bringing these here by using terms such as “politicians” or “evil”.
Does "evil" refer to religion? Or perhaps they meant "evil" in a more general way, as a more extreme version of "bad".
-
-
github.com github.com
-
The code is far simpler and easier to understand/verify
-
-
ubuntu.com ubuntu.com
-
Ubuntu also supports ‘snap’ packages which are more suited for third-party applications and tools which evolve at their own speed, independently of Ubuntu. If you want to install a high-profile app like Skype or a toolchain like the latest version of Golang, you probably want the snap because it will give you fresher versions and more control of the specific major versions you want to track.
-
-
-
This is open-source. You can always fork and maintain that fork yourself if you feel that's warranted. That's how this project started in the first place, so I know the feeling.
-
-
css-tricks.com css-tricks.com
-
Bordering an element with a single repeating image is something that seems like it should be easy with a property called border-image, but the process for actually doing that is somewhat counter-intuitive. Let’s say, for example, that you want to border an element with a repeating heart icon. You can’t do that with a image of a single heart. Instead, you have to make an image of a “frame” of hearts arranged as you’d like them to appear in the border, then slice that image. <img sizes="(min-width: 735px) 864px, 96vw" src='https://i2.wp.com/css-tricks.com/wp-content/uploads/2013/01/enlarged-border-image-slice.png' alt='' data-recalc-dims="1" />Eight hearts in a “frame” image, enlarged to show detail. The red lines indicate slices. If you think that sounds preposterous, you’re in good company. There was a lengthy discussion of the subject on Eric Myer’s blog a few years ago where many frontend development greats weighed in.
-
-
draveness.me draveness.me
-
a book on Golang
-
-
developer.mozilla.org developer.mozilla.org
-
CSS Grid Layout excels at dividing a page into major regions or defining the relationship in terms of size, position, and layer, between parts of a control built from HTML primitives.
-
-
css-tricks.com css-tricks.com
-
Making literal grids. Like X columns with Y gap between them homegrown framework stuff. grid-gap is wonderful, as gutters are the main pain point of grid systems.
-
-
askubuntu.com askubuntu.com
-
I'm very (VERY!) tempted to use that ppa, but without offense to it's maintainers... it's just some random ppa. If it had more "traction" I'd use it. Right now it has only 3 maintainers.
-
-
forums.theregister.com forums.theregister.com
-
Besides running contrary to the principles that lead a lot of people to Linux systems (a closed store that you can't alter...automatic updates you have no control over....run by just the one company)
-
If upstream code presumes things will work that dont in snap (e.g. accesses /tmp or /etc) the snap maintainer has to rewrite that code and maintain a fork. Pointless work. Packaging for .deb is a no-brainer.
-
Its not too complicated but it is an annoyance. I want /etc/hosts, /etc/resolv.conf, /etc/nsswitch.conf, /etc/rc.local and all the standard stuff to work. The heavy lifting is done in the kernel. All they need to do is leave it alone. Its getting harder to make Ubuntu behave like Linux.
-
if it's not broken, fix it until it is.
Tags
- if it's not broken, fix it until it is
- standard
- funny
- app stores: bad
- packaging software
- want it to just work
- first sighting
- annoying
- systemd: bad
- Linux: reasons people use/choose it
- snap: bad
- leave it alone
- could be easier / more difficult than it needs to be
- core values
- core principles
Annotators
URL
-
-
-
If components gain the slot attribute, then it would be possible to implement the proposed behavior of <svelte:fragment /> by creating a component that has a default slot with out any wrappers. However, I think it's still a good idea to add <svelte:fragment /> so everyone who encounters this common use case doesn't have to come up with their own slightly different solutions.
-
-
-
The CardLayout creates a store in context and the Card creates a standardized div container and registers it to the store so that the CardLayout has access to that DOM element. Then in afterUpdate you can move the DOM elements into columns and Svelte will not try to put them back where they go. It's a bit messy but it works.
-
-
knowledge.wharton.upenn.edu knowledge.wharton.upenn.edu
-
Day. G., Shea. G., (2020). COVID-19: 3 ways businesses can find growth opportunities during the crisis. World Economic Forum. Retrieved from https://www.weforum.org/agenda/2020/06/innovation-rethink-wharton-covid19-coronavirus
-
-
-
I would love to see this features as well, since it makes component composition and reuse a lot easier.
-
-
github.com github.com
-
You should default to the most permissive option imo and there really is no reason to check anything until you really need to If it were left to me I'd just use optional chaining, as it also eliminates the need for no-ops
(lazy checking)
-
-
stackoverflow.com stackoverflow.com
-
new Cmp will render to the DOM synchronously, so you don't have to worry about the content flickering because the component is rendered too late.
-
-
atomiks.github.io atomiks.github.io
-
"Headless Tippy" refers to Tippy without any of the default element rendering or CSS. This allows you to create your own element from scratch and use Tippy for its logic only.
-
It's a generic abstraction for the logic and styling of elements that pop out from the flow of the document and float next to a reference element, overlaid on top of the UI.
-
-
popper.js.org popper.js.orgTippy.js1
-
Popper has a sole goal: position elements. That's why we call it a "positioning engine" and not a "tooltip library".
-
-
www.thefxck.com www.thefxck.com
-
a story for production Positioning?
-
-
www.npmjs.com www.npmjs.com
-
Think first: why do you want to use it in the browser? Remember, servers must never trust browsers. You can't sanitize HTML for saving on the server anywhere else but on the server.
-
-
-
eth
Tags
Annotators
URL
-
-
discourse.ubuntu.com discourse.ubuntu.com
-
I don’t find the software slow, I find the startup time for snap packages when the start for the first time on a session slow, but that has been improved, and it’s public that the snapcraft team has been working hard to improve that.
-
What’s the use of ie. snap libreoffice if it can’t access documents on a samba server in my workplace ? Should I really re-organize years of storage and work in my office for being able to use snap ? A too high price to pay, for the moment.
-
I’m not a dev either, so no Ubuntu fork, but I will perhaps be forced to look at Debian testing, without some advantages of Ubuntu - but now that Unity is gone (and I deeply regret it), gap would not be so huge anymore…
-
If folks want to get together and create a snap-free remix, you are welcome to do so. Ubuntu thrives on such contribution and leadership by community members. Do be aware that you will be retreading territory that Ubuntu developers trod in 2010-14, and that you will encounter some of the same issues that led them to embrace snap-based solutions. Perhaps your solutions will be different. .debs are not perfect, snaps are not perfect. Each have advantages and disadvantages. Ubuntu tries to use the strengths of both.
Tags
- constant evolution/improvement of software/practices/solutions
- software performance
- forking: you can always fork it if you want
- Snap
- high-cost changes
- working on it (improving)
- moving/changing in a different direction than users want
- non-devs have more limited options
- not worth it
- advantages/merits/pros
- better for some but worse for others
- users just want to get work done
- disadvantages/drawbacks/cons
Annotators
URL
-
-
www.michaelseibel.com www.michaelseibel.com
-
via david
-
-
www.ruanyifeng.com www.ruanyifeng.com
-
startupclass.samaltman.com startupclass.samaltman.com
-
startup class
-
-
css-tricks.com css-tricks.com
-
If there’s a lot more to aligning icons to text than you expected, then you are not alone.
-
- Dec 2020
-
zhuanlan.zhihu.com zhuanlan.zhihu.com
-
kubevela, ali, kalm
-
-
github.com github.com
-
Dropped FFmpeg support (focus on primary functions instead)
Tags
Annotators
URL
-
-
github.com github.com
-
Jbuilder gives you a simple DSL for declaring JSON structures that beats manipulating giant hash structures. This is particularly helpful when the generation process is fraught with conditionals and loops.
-
-
github.com github.com
-
The only solution that I can see is to ensure that each user gets their own set of stores for each server-rendered page. We can achieve this with the context API, and expose the stores like so: <script> import { stores } from '@sapper/app'; const { page, preloading, session } = stores(); </script> Calling stores() outside component initialisation would be an error.
Good solution.
-
-
github.com github.com
-
I tried leaking session and page data and indeed it's easy. Too easy. So I definitely agree that session data should not be readable from anywhere but the request itself.
-
-
-
This would be cumbersome, and would encourage developers to populate stores from inside components, which makes accidental data leakage significantly more likely.
-
which makes it much harder to accidentally keep logged-in state visible after a client-side logout
-
-
github.com github.com
-
it focuses on compiling non-standard language extensions: JSX, TypeScript, and Flow. Because of this smaller scope, Sucrase can get away with an architecture that is much more performant but less extensible
-
-
wizardforcel.gitbooks.io wizardforcel.gitbooks.io
-
思路不错
-
-
www.indiehackers.com www.indiehackers.com
-
todoist.com todoist.com
-
You’re in good companyTrusted by leaders at some of the world’s most inspired organizations
How can they disclose this? Is it based on email address? Do they have permission?
-
-
www.npmjs.com www.npmjs.com
-
You can afford to make a proper PR to upstream.
-
No more waiting around for pull requests to be merged and published. No more forking repos just to fix that one tiny thing preventing your app from working.
This could be both good and bad.
potential downside: If people only fix things locally, then they may be less inclined/likely to actually/also submit a merge request, and therefore it may be less likely that this actually (ever) gets fixed upstream. Which is kind of ironic, considering the stated goal "No more waiting around for pull requests to be merged and published." But if this obviates the need to create a pull request (does it), then this could backfire / work against that goal.
Requiring someone to fork a repo and push up a fix commit -- although a little extra work compared to just fixing locally -- is actually a good thing overall, for the community/ecosystem.
Ah, good, I see they touched on some of these points in the sections:
- Benefits of patching over forking
- When to fork instead
Tags
- pull request stalled
- doing it right/properly
- irony
- taking the time to do it right/properly
- pull request
- limited time: not right now (maybe later)
- forking (patching vs. forking)
- proper
- when to _
- maintaining a fork while waiting for upstream to merge
- forking to add a desired missing feature/change
- making it easy to do the wrong thing
Annotators
URL
-
-
github.com github.com
-
Can this be merged please, this fixes a problem I have
-
-
github.com github.com
-
Unless we choose to use the semver ju-jitsu of calling the changes a bugfix
-
-
github.com github.com
-
May I ask what is holding this back?
-
-
github.com github.com
-
locked and limited conversation to collaborators
Why do they punish the rest of us (can't even add a thumb up reaction) just because someone was "talking too much" or something on this issue?
-
-
moderncto.io moderncto.io
-
doorDash CTO
Tags
Annotators
URL
-
-
zapier.com zapier.com
-
Why Zapier has always been 100% remote
Tags
Annotators
URL
-
-
samczsun.com samczsun.com
-
price oracle
-
-
consensys.net consensys.net
-
intro of PoS
-
-
-
intro of ETH2
-
-
number-none.com number-none.com
-
coding style
John Carmack on coding style
-
-
www.youtube.com www.youtube.com
-
seems interesting
-
-
www.youtube.com www.youtube.com
-
API Machinery SIG
-
-
github.com github.com
-
nice talks, especially from Daniel Smith
Tags
Annotators
URL
-
- Nov 2020
-
news.ycombinator.com news.ycombinator.com
-
make money?
-
-
www.scylladb.com www.scylladb.com
-
news.ycombinator.com news.ycombinator.com
-
There's a huge area of seemingly obvious user-centric products that don't exist simply because there isn't a working business model to support it.
-
-
github.com github.com
-
maybe a good reading material on k8s
-