12 Matching Annotations
- Jun 2021
-
stackoverflow.com stackoverflow.com
-
Different ways to prepend a line: (echo 'line to prepend';cat file)|sponge file sed -i '1iline to prepend' file # GNU sed -i '' $'1i\\\nline to prepend\n' file # BSD printf %s\\n 0a 'line to prepend' . w|ed -s file perl -pi -e 'print"line to prepend\n"if$.==1' file
-
- Feb 2021
-
github.com github.com
-
Examples of different ways of defining forms
Wow, that's a lot of different ways.
The inline_form way in particular seems interesting to me, though it's worth noting that that method is just an example, not actually part of this project's code, so it's not really a first-class option like the other options.
-
- Jan 2021
-
css-tricks.com css-tricks.com
-
overflow-wrap: break-word; makes sure the long string will wrap and not bust out of the container. You might as well use word-wrap as well because as the spec says, they are literally just alternate names for each other. Some browsers support one and not the other.
-
-
www.donielsmith.com www.donielsmith.com
-
Depending on what other component libraries you’ve used, you may be used to handling events by passing callback functions to component properties, or using a special event syntax – Svelte supports both, though one is usually more appropriate than the other depending on your situation. This post explains both ways.
-
- Nov 2020
-
stackoverflow.com stackoverflow.com
-
delete myObject.regex; // or, delete myObject['regex']; // or, var prop = "regex"; delete myObject[prop];
-
-
stackoverflow.com stackoverflow.com
-
can you not also use a .babelrc?
-
- Oct 2020
-
developer.mozilla.org developer.mozilla.org
-
An onevent event handler property serves as a placeholder of sorts, to which a single event handler can be assigned. In order to allow multiple handlers to be installed for the same event on a given object, you can call its addEventListener() method, which manages a list of handlers for the given event on the object.
-
-
-
An alternative (maybe not good) would be to restrict {@const} to certain blocks like {#each} and {#if}. In both cases, it significantly reduces the "multiple ways to do the same thing" problem and avoids ergonomic and performance overhead of our current situation.
-
it also allows for more divergence in how people write there code and where they put their logic, making different svelte codebases potentially even more different due to fewer constraints. This last point is actually something I really value, I read a lot of Svelte code by a lot of different people and broadly speaking things look the same and are in the same places.
Tags
- idiomatic code style (programming languages)
- uniformity
- strong conventions resulting in code from different code bases/developers looking very similar
- idiomatic pattern (in library/framework)
- programming: multiple ways to do the same thing
- convention
- consistency
- software development: code organization: where does this code belong?
Annotators
URL
-
-
github.com github.com
-
Solid supports templating in 3 forms JSX, Tagged Template Literals, and Solid's HyperScript variant.
-
- Sep 2020
-
github.com github.com
-
Lets not extend the framework with yet another syntax
-
- Apr 2020
-
guides.rubyonrails.org guides.rubyonrails.org
-
The handler can be a method or a Proc object passed to the :with option. You can also use a block directly instead of an explicit Proc object.
Example of: letting you either pass a proc (as a keyword arg in this case) or as a block.
-