How can I replace all elements with a string+variable in vscode? - replace

so we have these data-ui-test tags which is useful for me to write protractor tests, however all the values of said tags are the same at the moment. I want to replace all '<input' tags with '<input data-ui-test = "${someVariable}"', I am unable to do this in the search&replace bar (ctrl+shft+f).
I am utterly clueless on how to approach the problem
Please if you have any idea on how to do this, please let me know.

Related

Remove everything from a cell thats within <> in Google Sheets

I know there are a lot of topics about removing characters from Google Sheets cells. I've tried to find a way how to solve my issue with the information on the web / stackoverflow but I can't find it...
I need to create a column with text in multiple rows. The original file still has styling codes <p> <strong> <i> etc in it. I need to remove these styling codes. So actually every <> code should be removed from the cell. I tried to do this with substitute but than I can only say f.e. remove <p> and I'm still having the other styling codes in the sheet.
I think this could be done with REGEXREPLACE but I cant get it working. I hope that someone can help me to understand how I can get this working. Thank you!
use:
=ARRAYFORMULA(REGEXREPLACE(D2:D, "<.*?>", ))
in some cases that wont be enough so:
=ARRAYFORMULA(REGEXREPLACE(D2:D, "<\/\w+>|<\w+.*?>", ))
and in some cases even that wont be enough so:
=ARRAYFORMULA(REGEXREPLACE(D2:D, "</?\S+[^<>]*>", ))

Analytics Goal Funnel Regex doesn't recognize "example.html?p=2"

I have my goal funnel set up and this is the regex for one of the stages: ^/shop/(.*)
This will match pages such as /shop/collections/art.html but when I look at the goal funnel, it says people are dropping out by going to pages like /shop/collections/art.html?p=2. Notice the ?p=2 is the only difference here.
I tried to do it as ^/shop/((.|\?)*) but I'm not sure that's fixing it.
How do I fix this?

emacs flyspell disable for custom latex macros

I have the following LaTeX code which has some custom macro's and environments which i would like to exclude from flyspell.
Some normal text
\begin{customenv}
Please dont flyspell-this
\end{customenv}
again some normal text (please flyspell this) and some \customcode{dont-flyspell-this}.
I know I need to write a function to pass to flyspell-mode-predicate but I'm haveing some trouble getting it to work for both the \customcode and the \begin{customenv} and \end{customenv}.
Any suggestions are welcome.
Update:
It seems i can set the following:
(setq flyspell-tex-command-regexp
"\\(\\((\\(begin\\|end\\)[ \t]*{\\|\\(cite[a-z*]*\\|label\\|ref\\|eqref\\|usepackage\\|documentclass\\|customcode\\)[ \t]*\\(\\[[^]]*\\]\\)?{[^{}]*\\)\\|\\\\begin{\\(customenv[1-9]*\\)}\\(.\\|\n\\)*\\\\end{\\(customenv[1-9]*\\)}\\)")
This seems to work for the \customcode{stuff} but it still doesn't skip the text in customenv

Customizing Containable Content in Orchard CMS

I am currently trying to understand a bit more about how Orchard handles Lists of Custom Content Types and I have run into a bit of an issue.
I created a Content Type named Story, which has the following parts:
Body
Common
Containable
Route
I created a list that holds these items, and all I am attempting to do is style them in such a way:
Story Title
Story Description (Basically a truncated version of the body?)
However, I cannot seem to figure out how to do the following:
Get the Title to actually appear (Currently all that appears is the body and a more link)
Remove the "more" link (and change this to be the actual Title)
I have looked into changing the Placement.info, and have looked all over in an attempt to find where the "more" link is added in each of the items. Any help would be greatly appreciated.
I finally managed to figure it out - Thanks to the Designer Tools Module, which made it very simple to go look into what was going on behind the scenes during Page Generation.
Basically - all that was necessary to accomplish this was to make some minor changes to the Parts.Common.Body.Summary.cshtml file. (found via ../Core/Common/Views/)
Which initially resembles the following:
#{
[~.ContentItem] contentItem = Model.ContentPart.ContentItem;
string bodyHtml = Model.Html.ToString();
var body = new HtmlString(Html.Excerpt(bodyHtml, 200).ToString()
.Replace(Environment.NewLine,"</p>"+Environment.NewLine+"<p>"));
}
<p>#body #Html.ItemDisplayLink(T("more").ToString(), contentItem)</p>
however by making a few changes (by using the Designer Tools) I change it into the following:
#{
[~.ContentItem] contentItem = Model.ContentPart.ContentItem;
string bodyHtml = Model.Html.ToString();
string title = Model.ContentPart.ContentItem.RoutePart.Title;
string summary = Html.Excerpt(bodyHtml, 100) + "...";
}
<div class='story'>
<p>
#Html.ItemDisplayLink(title, contentItem)
</p>
<summary>
#summary
</summary>
</div>
Although it could easily be shortened a bit - It does make the styling quite a big easier to handle. Anyways - I hope this helps :)
Alternately you can use the placement.info file in your theme assign different fields to your Summary and Detail views. It's much simplier.
http://orchardproject.net/docs/Understanding-placement-info.ashx
But, I used the same method you did till I discovered the .info file as well. It works and gives you a good understanding of how the system works, but the placement.info file seems easier.
Also, you probably don't want to be editing the view files in Core. I think your meant to override views in your theme directory.

Is it possible to use different tags files for omnicomplete and general tag browsing in Vim?

I've been using ctags in Vim for years, but I've only just discovered omnicomplete. (It seems good.)
However, I have a problem: to get omnicomplete working properly I have to use the --extra=+q option when generating the tags, which is fine, but this then changes the behaviour of general tag browsing in ways that I do not like.
For example, when tab-completing tag names in Vim I don't want to tag "into" the "hierarchies" of classes - that is, when tab completing "Clas" get "ClassA, ClassA::var1, ClassA::var2, ClassB", instead of "ClassA, ClassB" - but that's what happens when using --extra=+q.
So I guess I'm after one of two things. Either:
1. The ability to disable tab-completing into "tag hierarchies" even though those hierarchies do exist in the tags file. Or,
2. The ability to use differently named tags files (ie. generated with different options) for omnicomplete and general tag browsing.
Any ideas would be much appreciated!
Cheers,
thoughton.
OK, I think I've actually come up with an answer to my own question.
Firstly, I generate two tags files: tags_c_vim and tags_c_omni.
In my _vimrc I have:
let tags_vim='tags_c_vim'
let tags_omni='tags_c_omni'
exe "set tags=".tags_vim
to setup some variables pointing to the different tags files, and to set the "vim" tags to be the default tags.
Then I also have this, again in the _vimrc:
imap <F8> <ESC>:exe "set tags=".tags_omni<CR>a<C-X><C-O>
autocmd InsertLeave * if pumvisible() == 0|exe "set tags=".tags_vim|endif
the first line here maps F8 so it changes the tags setting to point to the "omni" tags before then invoking the omnicomplete popup menu, and the second line resets the tags setting to the "vim" tags when insert mode is next left after the popup has closed.
It's going to need some extensive use to make sure it's robust enough, but it does seem to work after some quick testing.
Two improvements I'd still like to make:
Map the setting of the "omni" tags to the omnicomplete C-X,C-O command instead of a new F8 mapping. (I think I need to set the tags and then call omni#cpp#maycomplete#Complete(), but I couldn't work out how to do this)
Hook the resetting of the "vim" tags into either omnicomplete itself finishing or the popup menu closing
Anyway, I just thought I'd share.
Cheers,
thoughton.
You could try the OmniCppComplete plugin.