Rows restriction within a function [duplicate] - google-apps-script

This question already has answers here:
Why does google script editor stop paren matching after 100 lines in a function and does it affect the code?
(2 answers)
Closed 2 years ago.
I've written 99 rows of code within my function. And when I had trying to add a new one(just by clicking Enter inside), I have seen that color of my function curly brackets changed from green to red.
It seems like in-built restriction of google apps script, but I haven't found anything about it...
So, what is the reason of changing color? Are there other technical restrictions exist?

It is only a limitation of the syntax highlighting within the Script Editor, your function will still execute as normal, even if it is much longer than 100 lines.
I have noticed this on many occasions and wasted some time trying to find the cause, thinking it was due to a syntax error in my code. Eventually I realized that if there was too much space between the braces the highlighting no longer worked. However I didn't know the limit was precisely 100 lines, so thank you for that information :)

Related

Taking the output of a checklist in Microsoft Forms and using Power Automate to turn it into a bulleted list that can be sent to a Teams channel

As the title states, I am trying to take a checklist from Forms and transform it into a bulleted list. So far, I have been able to format the checklist with line breaks after separating the array into multiple lines, as shown below.
The problem that I am having at the moment is the fact that I would like to add bullets to said list, and I am not sure how. I've tried to use the join function with HTML's tag, but I quickly realized that it's obviously not going to work that way.
So my question is, how do I turn what I have now into a bulleted list? Should I make a loop with Power Automate? Or is there a better way to do it? (I'm very new to Power Automate and HTML)
This is the line of code I used to separate the array:
json(outputs('Get_response_details')?['formExampleID'])
If there is anything that I'm missing, I apologize and I would be happy to provide. Thank you in advance!
I think you're on the right track. I'm not familiar with the json function, so if that can be put into an array you can use this solution.
Otherwise, use the split() function on the Get_response_details and loop that into an array.
Then, for the length of the array, using a loop, use concat('• ',first(array[i])) while putting however many spaces after the bullet that you want. I put 3 in this example.
Then you simply do another loop for (or build into the same loop) your output.

Restricting user to input special-characters using Angular [duplicate]

This question already has answers here:
Proper way to restrict text input values (e.g. only numbers)
(18 answers)
Closed 2 years ago.
User is allowed to enter all the alphabets and numbers but when the special-characters are entered then it shouldn't be entered in the the text box.
I tried doing this using (ng-pattern-restrict) but it's not working as expected, I think it might be possible that it needs to be imported in
app-module.ts but not working.
HTML FILE
#Shashank has a valid point of view. What you want to do is disable the entry of special characters from the backend, as well as render the field invalid from the frontend. A hacker knowing what they're doing would easily manipulate the HTTP Request itself rather than the field, making it pretty vulnerable.
However, if you insist on your solution, I would recommend using RegEx. This sample expression might come in handy. That way, whenever the input field detects one of these special characters, it would replace that character with a ''

Split src attribute over multiple lines [duplicate]

This question already has answers here:
String attribute values in multiple lines, HTML
(6 answers)
Adding a linebreak in some attribute string(like src or href ) in HTML / XML source
(1 answer)
Closed 3 years ago.
I have an HTML element that looks something like,
<element src="http://lsdjflksjdfkjewiojeriowjekwjekfljsdkfjisdjrsekjfijsiejisjojfsjlfejeileldjfsleisldkjfsiejljefijeljslefifjfsleif">
</element>
See how long that is?
I want to break up the src link into multiple lines.
In Python you would just use \ to break a long string into multiple lines. In JavaScript, you just use + "rest of string" to break it into multiple lines. What is the case for HTML? The browser wants to interpret my attempt as white space...
So when I did:
<element
src="http://lsdjflksjdfkjewiojeriowjekwjekfljsdkf
jisdjrsekjfijsiejisjojfsjlfejeileldjfsleisldkjfsiejljefi
jeljslefifjfsleif">
</element>
It inserted a bunch of %20 where the line breaks were. What else should I try?
On a similar post on Stack Overflow that addresses this issue, it suggests using JavaScript to split the lines up, which seems like overkill, and the answer that suggested splitting after '/'s in the URL seems not to work unless you cram the entire element on the left side of the page which would cause horrible formatting issues... Otherwise, it still put spaces in the link.
Google URL Shortener has been retired and has transitioned to Firebase Dynamic Links.
But in general, using a link shortener for external resources is a pretty terrible idea. There will inevitably be some overhead in using an external link shortener, you'll be at their mercy in the event of an outage or EOL, and there may be the possibility of redirect/poison attacks as well.

Stop Less Than Symbol Beginning New Line in Pre-Tagged Text

I have already posted this here here, and will notify this forum immediately of any developments there, though in the mean time I would very much appreciate some help.
Apologies also if I have not tagged this question correctly here.
I am using some code I found on another site so that I can wrap my text inside pre-tags for posts I make on my blog. I have it nearly all as I want apart from the fact that I cannot get it to NOT begin a new line at every occurrence of a less-than symbol.
I will try to past the code below but I imagine it may be affected by the editor so apologies in advance.
Many thanks
<pre style="white-space:pre-wrap;word-wrap:break-word;">=IF(ROWS(G$1:G1)>$F$1,"",INDIRECT(TEXT(SMALL(IF(TRANSPOSE($A$1:$D$6)<>"",TRANSPOSE(10^(4+COLUMN($A$1:$D$6))*ROW($A$1:$D$6)+COLUMN($A$1:$D$6))),ROWS(G$1:G1)),"R0C"&REPT(0,LEN(SMALL(IF(TRANSPOSE($A$1:$D$6)<>"",TRANSPOSE(10^(4+COLUMN($A$1:$D$6))*ROW($A$1:$D$6)+COLUMN($A$1:$D$6))),ROWS(G$1:G1)))-1)),0))</pre>

How do I post a sample of PHP code on my webpage? [duplicate]

This question already has answers here:
How do I display PHP code in HTML?
(4 answers)
Closed 8 years ago.
I want to post a sample of some code I've written. I'm aware of the <code></code> tags, but the problem is that the PHP inside will actually get interpreted and executed when the page loads. What is the way around this?
You should be encoding your entities anyway, which will prevent PHP from parsing them.
Instead of <?php, use <php.
See also: What Are The Reserved Characters In (X)HTML?
If you want to display the source of an entire PHP script, you can use the show_source() function. For example,
show_source("sample.php");
If you want to display the code of the current page, you can do something like
show_source(__FILE__);
You can also use hightlight_file() in place of show_source().
If you were looking to display just a random line of code, you can use htmlspecialchars() or htmlentities(). For example,
htmlspecialchars(" <b> This will be a bold text </b> ");
A tip on the aside: Please look around, and google atleast once before asking. :)