7 Questions

How to loop an each block a specific x number of times in Svelte? I know of Svelte's [`{#each}`](https://svelte.dev/docs/svelte/each) block which allows you to iterate over arrays or array-likes. ```svelte <script lang="ts"> let names: string[] = ["bob", "joe", "Frankenstein"]; </script> {#each names...
0 votes 9 views 1 Answer Asked about 18 hours ago
How to get epoch time in Rust? How can I get the current system [epoch time](https://en.wikipedia.org/wiki/Unix_time) in milliseconds/seconds (and to a lesser extent nanoseconds and microseconds) in Rust?
1 vote 12 views 1 Answer
Asked 1 day ago
w
44
How can I convert raw markdown to plaintext in TypeScript/JavaScript? I'm working on adding [structured data](https://developers.google.com/search/docs/appearance/structured-data/intro-structured-data) to question pages on solvin (more specifically implementing [QAPage](https://developers.google.com/search/do...
0 votes 7 views 1 Answer
Asked 3 days ago
s
56
Should I write string function arguments as &str, String, AsRef<str>, or Into<String> in Rust? I'm developing a public Rust library and I'm unsure how to handle function parameters that deal with strings. There seem to be multiple idiomatic options: - `&str` - `String` - `impl AsRef<str>` - `impl Into<String>` Each of these works i...
2 votes 14 views 1 Answer Asked 5 days ago
Font Size Inherit - Tailwind CSS I would like to apply inherited font size to an element with Tailwind. I know that this can be achieved in regular CSS like so: ```css .element { font-size: inherit; } ``` But how would I accomplish this using purely Tailwind class sy...
1 vote 15 views 1 Answer Asked 5 days ago
w
44
What is the difference between gap-x and space-x in TailwindCSS? I’ve seen both `gap-x/y-*` and `space-x/y-*` used in Tailwind examples to create spacing between elements. What is the actual difference between them? Are they interchangeable, or is one preferable in certain situations?
2 votes 38 views 1 Answer Asked 6 days ago
w
44
How to parse an integer from a string in Zig? What is the proper way to parse an integer from a string in Zig, while being able to specify the resulting integer type? ```zig const foo = "96"; ``` How would I convert `foo` to an `i32`, for example?
3 votes 33 views 1 Answer Asked 6 days ago
J
J
99