7 Matching Annotations
- 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.
-
- Nov 2022
-
developer.mozilla.org developer.mozilla.org
-
If you need to encode Unicode text as ASCII using btoa(), one option is to convert the string such that each 16-bit unit occupies only one byte.
-
- Jun 2022
-
stackoverflow.com stackoverflow.com
-
This actually is possible with JavaScript, though browser support would be spotty. You can use XHR2 to download the file from the server to the browser as a Blob, create a URL to the Blob, create an anchor with its href property and set it to that URL, set the download property to whatever filename you want it to be, and then click the link. This works in Google Chrome, but I haven't verified support in other browsers. window.URL = window.URL || window.webkitURL; var xhr = new XMLHttpRequest(), a = document.createElement('a'), file; xhr.open('GET', 'someFile', true); xhr.responseType = 'blob'; xhr.onload = function () { file = new Blob([xhr.response], { type : 'application/octet-stream' }); a.href = window.URL.createObjectURL(file); a.download = 'someName.gif'; // Set to whatever file name you want // Now just click the link you created // Note that you may have to append the a element to the body somewhere // for this to work in Firefox a.click(); }; xhr.send();
-
- Jun 2021
-
sveltematerialui.com sveltematerialui.com
-
Use this to build a ClassAdder component. ClassAdder components are useful for reducing the size of your bundle. If you have tons of simple components that just need to add classes/props or set a context, using ClassAdder components means there's only one "big" Svelte component in your bundle for all of these many tiny components.
-
This is useful when you need to add classes to a component, since Svelte's "class:" directives don't work on components.
-
- Jan 2021
-
github.com github.com
-
Can't find the Svelte way of doing this, setTimeout helps now, but this is not a good way working with a framework I think.
-
- Sep 2020
-
-
Currently, I can only do this with some ugly JS, by wrapping the <slot> in a div and then selecting all direct children of that div (div>*). But this fix/solution also makes me face a problem: The <div> partially destroys the layout/design compared to when not using that div wrapper.
-