53 Matching Annotations
- Jan 2024
-
-
It can sort of be achieved with the current setup (via labels), but I really like where this is going -- turning everything into a similar "object" in a hierarchy rather than separate standalone structures that connect and get "labeled" to show what they are.
-
- Dec 2023
-
gitlab.com gitlab.com
-
Enable ActiveRecord unsigned integers to use 8 bytes instead of 4. This fixes the ActiveModel::RangeError problem where AR models with perfectly fine 8 bytes primary keys are taken for ActiveModel::Type::Integer with a default limit of 4 bytes.
-
- Dec 2022
-
stackoverflow.com stackoverflow.com
-
Procs can't accept blocks as implicit arguments (the format you're trying). A proc can receive other proc objects as arguments, either explicitly, or using & arguments. Example: a = Proc.new do |&block| block.call end a.call() {puts "hi"}
-
- Nov 2022
-
nickjanetakis.com nickjanetakis.com
-
Lucky for us, it’s super easy to use subdomains in development nowadays. http://lvh.me is a free service that resolves itself along with all subdomains to localhost.
-
- Oct 2022
-
github.com github.com
-
var a = document.createElement("a"); a.href = blob; a.target = "_blank"; setTimeout(function() { click(a); });
-
- Nov 2021
-
svelte.dev svelte.dev
-
If you need to pass multiple arguments to an action, combine them into a single object, as in use:longpress={{duration, spiciness}}
-
- Apr 2021
-
github.com github.com
-
For now, you will need to give the second root a different named route: authenticated :user do root to: "users#index", as: :authenticated_root end unauthenticated do root to: "main#index" end
-
- Mar 2021
-
askubuntu.com askubuntu.com
-
neither knows what to do with naked domain. So gnome-open http://askubuntu.com works but not gnome-open askubuntu.com. Here is a small function to make it easier to type and accept the stripped down domain name. function go { gnome-open http://$1 ; }
-
-
github.com github.comd3/d31
-
To the consternation of some users, 3.x employed Unicode variable names such as λ, φ, τ and π for a concise representation of mathematical operations. A downside of this approach was that a SyntaxError would occur if you loaded the non-minified D3 using ISO-8859-1 instead of UTF-8. 3.x also used Unicode string literals, such as the SI-prefix µ for 1e-6. 4.0 uses only ASCII variable names and ASCII string literals (see rollup-plugin-ascii), avoiding encoding problems.
-
-
stackoverflow.com stackoverflow.com
-
You can use the :placeholder-shown pseudo class. Technically a placeholder is required, but you can use a space instead.
-
-
css-tricks.com css-tricks.com
-
:placeholder-shown is super useful for us here! It’s basically the secret selector for testing if an input currently has a value or not.
-
-
-
Dave Rupert has a good solution that uses an input's invalid event. Instead of using the :invalid pseudo selector, he adds a CSS class to the input when it becomes invalid. We will extend this approach by removing the CSS class when the element becomes valid again.
-
- Feb 2021
-
stackoverflow.com stackoverflow.com
-
# catch multi-char special key sequences read -sN1 -t 0.0001 k1 read -sN1 -t 0.0001 k2 read -sN1 -t 0.0001 k3 key+=${k1}${k2}${k3}
-
-
github.com github.com
-
A.joins(:b) .where( A.arel_table[:something_a].eq('xxx').or(B.arel_table[:something_b].eq('yyy')) )
-
- Jan 2021
-
-
Change any of the <option> by double clicking on the number.
-
-
forums.theregister.com forums.theregister.com
-
It won't work if $HOME is not under /home. Really. Not even if you softlink. You need a bind mount
-
Why did I put the kdb in the snap file system? Because the app is sandboxed, so I had no choice.
-
-
-
I think this is very important feature to implement. Because for now we need to wrap target components by useless wrapper nodes.
-
-
github.com github.com
-
// read-only, but visible to consumers via bind:start export let start = 0;
Can't do
export const start = 0
(because it needs to be mutable/assignable within this local component), so we have to do
export let start = 0
with a comment saying that it's read-only (by the consumer).
-
-
stackoverflow.com stackoverflow.com
-
JSONP is really a simply trick to overcome XMLHttpRequest same domain policy. (As you know one cannot send AJAX (XMLHttpRequest) request to a different domain.) So - instead of using XMLHttpRequest we have to use script HTMLl tags, the ones you usually use to load JS files, in order for JS to get data from another domain. Sounds weird?
-
- Dec 2020
-
www.npmjs.com www.npmjs.com
-
Yarn only runs the postinstall hook after yarn and yarn add, but not after yarn remove. The postinstall-postinstall package is used to make sure your postinstall hook gets executed even after a yarn remove.
-
- Nov 2020
-
stackoverflow.com stackoverflow.com
-
Thanks so much for the reply! Due to space limitations for comments, I have appended my reply to my original question. Thanks again! (P.S. I can't up-vote your reply until my rep hits 15... Sorry about that.)
-
-
github.com github.com
-
...Then I just make sure that all my $: reactive statements also check whether the values are initialized or not. It's hacky, but it avoids the double render.
-
-
-
It won't work in all use cases, but it's better than the div soup.
-
I run into this on almost every project and end up doing this as a workaround: :global([slot="content"]) This allows me to style that extra div in the component that contains the slots but it would be super nice to have <MyComponent slot="content"/> and eliminate that extra div
-
If this is getting implemented, I think I'll love to see both implemented. I can see a lot of use cases where I would like to encapsulate the component with additional wrappers and in another scenarios I would like to just use the component. Now i work around this using empty div but then at times it breaks the structure because of the div element and I'll have to add more class utilities to make it work. This will be a great addition for Svelte.
-
-
-
I also tried to use <!-- svelte-ignore unused-export-let --> before the script tag but still no chance.
-
-
github.com github.com
-
You can only adopt a workaround, which can be one of
-
- Oct 2020
-
github.com github.com
-
But also, if you do want to use separate functions and have your dependencies still counted, you can make all of the relevant dependencies be arguments to those functions, so the compiler can see them in the reactive block.
-
-
github.com github.com
-
if you make a shallow copy, it works
-
-
github.com github.com
-
We aim to support all svelte features. In some cases this is not possible. For those cases we provided feasible workarounds.
-
jsx currently does not allow to use : in attribute/property names. As a workaround every : can be replaced be _ (for example bind_value is converted to bind:value for svelte).
-
-
tech.ebayinc.com tech.ebayinc.com
-
Offsetting the rules of a logic-less template requires a lot of helper methods.
-
-
-
I had this problem and figured out how to make something like this work with the compiler quirks.
-
-
github.com github.com
-
React hook for creating a value exactly once. useMemo doesn't give this guarantee unfortunately - https://reactjs.org/docs/hooks-faq.html#how-to-create-expensive-objects-lazily
-
- Sep 2020
-
svelte.dev svelte.dev
-
github.com github.com
-
The problem with working around the current limitations of Svelte style (:global, svelte:head, external styles or various wild card selectors) is that the API is uglier, bigger, harder to explain AND it loses one of the best features of Svelte IMO - contextual style encapsulation. I can understand that CSS classes are a bit uncontrollable, but this type of blocking will just push developers to work around it and create worse solutions.
Tags
- trying to prevent one bad thing leading to people doing/choosing an even worse option
- +0.9
- missing out on the benefits of something
- Svelte: how to affect child component styles
- important point
- arbitrary limitations leading to less-than-ideal workarounds
- key point
- Svelte: CSS encapsulation
Annotators
URL
-
-
github.com github.com
-
Would style .classInChild from your parent. The only drawback is that you might need an extra wrapping element.
-
-
github.com github.com
-
For my simple tooltip example, I could create a TooltipHitbox component with a <slot/> inside a <div use:myTooltip={tooltipProp}> and then wrap MatButton instances with that component.
-
-
github.com github.com
-
Also, I'm starting to wonder if maybe it's okay to have multiple spreads? If the alternative to <Foo {...a} {...b} {...c} d={42}> is that people will write <Foo {...Object.assign({}, a, b, c)} d={42}> anyway, then do we gain anything with the constraint?
-
-
github.com github.com
-
{#each section as {tag, is_self_closing, props, content}} {#if is_self_closing} <{tag} {...props} /> {:else} <{tag} {...props}>{content}</{tag}> {/if}
-
-
github.com github.com
-
Even without going to that extreme, the constraint of having a single <style> can easily force component authors to resort to the kinds of classes-as-namespaces hacks that scoped styles are supposed to obviate.
-
-
github.com github.com
-
:global just feels like a hack for a feature that should already be there.
-
-
github.com github.com
-
Force everything to the git root per NPM lameness
-
- Jul 2020
-
stackoverflow.com stackoverflow.com
-
Creating and calling a default proc is a waste of time, and Cramming everything into one line using tortured constructs doesn't make the code more efficient--it just makes the code harder to understand.
The nature of this "answer" is a comment in response to another answer. But because of the limitations SO puts on comments (very short length, no multi-line code snippets), comment feature could not actually be used, so this user resorted to "abusing" answer feature to post their comment instead.
See
-
- May 2020
-
-
This is it. I'm done with Page Translator, but you don't have to be. Fork the repo. Distribute the code yourself. This is now a cat-and-mouse game with Mozilla. Users will have to jump from one extension to another until language translation is a standard feature or the extension policy changes.
-
None of these methods are ideal and honestly, I'd only blame Mozilla for this. They dismiss all our efforts as incorrect but refuse to provide the correct solution.
-
- Jan 2020
-
unix.stackexchange.com unix.stackexchange.com
-
ssh doesn't let you specify a command precisely, as you have done, as a series of arguments to be passed to execvp on the remote host. Instead it concatenates all the arguments into a string and runs them through a remote shell. This stands out as a major design flaw in ssh in my opinion... it's a well-behaved unix tool in most ways, but when it comes time to specify a command it chose to use a single monolithic string instead of an argv, like it was designed for MSDOS or something!
-
-
unix.stackexchange.com unix.stackexchange.com
-
I think, it's better to replace \n symbol with some other symbol, and then work as usual:
-
- Dec 2019
-
reactjs.org reactjs.org
-
This problem can also come up when you use npm link or an equivalent. In that case, your bundler might “see” two Reacts — one in application folder and one in your library folder. Assuming myapp and mylib are sibling folders, one possible fix is to run npm link ../myapp/node_modules/react from mylib. This should make the library use the application’s React copy.
-
- Nov 2019
-
material-ui.com material-ui.com
-
This does not set the native input element to indeterminate due to inconsistent behavior across browsers. However, we set a data-indeterminate attribute on the input.
-
-
gist.github.com gist.github.com
-
// This is not really a mock, but jest prevents out of scope // variables unless prefixed with "mock".
-
-
stackoverflow.com stackoverflow.com
-
cant you see he has only 11 reputations, and how can he comment?
-