Questions tagged [code-snippets]
For issues relating to the creation, use, and maintenance of code snippets.
code-snippets
1,944
questions
0
votes
1
answer
17
views
How can I make hashing algorithm for code snippets?
I would like to make an algorithm, which can detect code snippets when iterating through source codes, based on some hashing algorithms.
So for example, here is that short code snippet from a fragment ...
-3
votes
0
answers
42
views
Why do post/pre-Increment operations behave unexpectedly in printf statements? [duplicate]
I was solving a code snippet in C [taken from competitive exam JECA 2023] that involved post/pre-increment operations. It seemed very simple, and I dry-ran it using the usual logic for post/pre-...
1
vote
0
answers
8
views
Embedding promotion text into article at diffrent points
We have promotional text (text A) that we want to embed into in article (text B) at specific different points, e.g. at 25% or 50% etc. The problem is, after adding it, text A is not displaying in text ...
0
votes
0
answers
30
views
Macros, Code Snippets, or even Keyboard Shortcuts not working in Visual Studio 2008 for C++
I am working in Visual Studio 2008 and cannot update due to constraint of my software compatibility issue. I search everywhere on the Internet, read many posts here as well, but no solution found to ...
1
vote
0
answers
50
views
What are the effects of "Show new snippet experience (experimental)" setting in Visual Studio 2022?
Recently, I have encountered a new option in Visual Studio 2022 "Show new snippet experience (experimental)" setting in Visual Studio 2022?".
It is located in the VS Options: "Text ...
0
votes
0
answers
13
views
I am having issues to get the piece of code in my snippet whith the html labels
This is my snippet and what I hope to get when I write "html-em" in my html file:
{
"HTML EM template": {
"prefix": "html-em",
"body": [
...
0
votes
1
answer
27
views
"Code Snippets" snippet does not work for `big_image_size_threshold` setting
I have WordPress 6.5.2, "Code Snippets" plugin 3.6.4 installed and following snippet code:
add_filter( 'big_image_size_threshold', '__return_false' );
but it does not work, WordPress still ...
0
votes
0
answers
26
views
Retrive the value of the Active variation of the product and then link it to the "read more" to dynamically change
Here is the code snippet where Only the tab description is attached to the "Read-more". How to make it dynamically change based on the currently active value of the Variation - material ...
0
votes
0
answers
122
views
Add custom VSCode style snippets to NVChad
Using Neovim with NVChad.
I have read the documentation but can't get it to work unless I add my custom snippets to the default friendly-snippets folder.
According to the NVChad docs:
-- vscode format ...
-2
votes
1
answer
66
views
Code Snippet for Add to Cart Redirect only works for the Add to Cart Button in SINGLE PRODUCT PAGE
The code snippet for redirecting the add to cart to the checkout page only works when I press the add to cart on the SINGLE PRODUCT PAGE. It does not work when I click the add to cart button on the ...
0
votes
0
answers
8
views
Snippet - Change Add to Cart Button
I need a snippet code to change add to cart button to below text (if the product is on back order:
Back Order (1-5 weeks to arrive)
Do anyone knows how to make the snippet!
What I need is the below:
...
0
votes
0
answers
23
views
neovim making snippets write in lua with nvim_set_keymap
i want to set keymap for lua to be sinppets for example:
vim.api.nvim_set_keymap("n", "<leader>rs", ":call append(line('.'), [[welcome]])<CR>")
and now i ...
0
votes
0
answers
38
views
WooCommerce Add to cart issue
I have been trying to add a custom functionality via code snippet to my WooCommerce product page, there are two error in the logs :
ajax-single-add-to-c….min.js?ver=2.2.9:1POST https://...
0
votes
0
answers
58
views
VS Code react-bootstrap quick import and snippet not showing
Why is my react-bootstrap snippets suddenly not showing? I was working on a project with React JS and the react-bootstrap element suggestions are displaying fine. However just recently, it stopped ...
0
votes
1
answer
30
views
jMeter - How to escape quotes?
I need help to escape quotes in jMeter!
I've to put into a var some words with quotes, for example "dummy", so I've tried with:
vars.put("example", '"dummy"')
vars.put(&...