v1 Online Demo: https://codesandbox.io/s/v1-angular-numeric-ljwlb
v2 Online Demo: https://codesandbox.io/s/v2-angular-numeric-3w2wr
| /** | |
| * Sanitizes input data to mitigate potential security risks by removing or escaping | |
| * special characters, HTML entities, Unicode characters, and null bytes. | |
| * | |
| * @param input The input data to be sanitized. | |
| * @returns A sanitized version of the input data. | |
| */ | |
| function sanitizeData(input: string): string { | |
| /** | |
| * Removes carriage return characters (\r). |
| function generateRandomNumber(length: number): number { | |
| return parseInt( | |
| Math.ceil(Math.random() * Date.now()) | |
| .toPrecision(length) | |
| .toString() | |
| .replace('.', ''), | |
| 10 | |
| ); | |
| } |
| import { Pipe, PipeTransform } from '@angular/core'; | |
| /** | |
| * Log pipe is used for debugging purposes allows quickly log to the console a template value. | |
| * | |
| * @example | |
| * <!-- Log value to a console. --> | |
| * <div> | |
| * {{ foo.value | log }} | |
| * </div> | |
| */ |
| import { | |
| Directive, | |
| TemplateRef, | |
| ViewContainerRef, | |
| OnInit, | |
| } from "@angular/core"; | |
| import { AuthService } from "./auth.service"; | |
| @Directive({ | |
| selector: "[isAuthenticated]", |
| import { NgModule } from '@angular/core'; | |
| import { BrowserModule } from '@angular/platform-browser'; | |
| import { HttpClientModule, HTTP_INTERCEPTORS } from '@angular/common/http'; | |
| import { RequestTimeoutHttpInterceptor, DEFAULT_TIMEOUT } from './interceptors'; | |
| import { AppComponent } from './app.component'; | |
| @NgModule({ | |
| imports: [ | |
| BrowserModule, | |
| HttpClientModule, |
| -- Find users ID that have the same email address | |
| SELECT u.id FROM `user` AS u | |
| INNER JOIN | |
| ( | |
| SELECT email FROM `user` | |
| GROUP BY `user`.email HAVING count(id) > 1 | |
| ) AS u2 ON u2.email = u.email; |
v1 Online Demo: https://codesandbox.io/s/v1-angular-numeric-ljwlb
v2 Online Demo: https://codesandbox.io/s/v2-angular-numeric-3w2wr
| window.getAllAngularRootElements() |
Credit to: https://www.kevinsimper.dk/posts/how-to-convert-privatekey-into-singleline
Sometimes you need to convert a file with newlines into a singleline, essentially turning newline characters into newline "\n", but that can be pretty difficult as most programs turns that into a actual newline, which is difficult to copy.
But using awk we can turn a file into a single line of text, perfect for a environment variable. However, remember that privatekeys shouldn't be stored in the environment for security reasons, it should live as a file.
$ awk -v ORS='\\n' '1' karnov-review.2019-01-21.private-key.pem | pbcopy
alias pbcopy='xclip -selection clipboard'
http://www.ex-parrot.com/~pdw/Mail-RFC822-Address.html
`(?:(?:\r\n)?[ \t])(?:(?:(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t]
)+|\Z|(?=[["()<>@,;:\".[]]))|"(?:[^\"\r\\]|\.|(?:(?:\r\n)?[ \t]))"(?:(?:
\r\n)?[ \t]))(?:.(?:(?:\r\n)?[ \t])(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(
?:\r\n)?[ \t])+|\Z|(?=[["()<>@,;:\".[]]))|"(?:[^\"\r\\]|\.|(?:(?:\r\n)?[
\t]))"(?:(?:\r\n)?[ \t])))@(?:(?:\r\n)?[ \t])(?:[^]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[["()<>@,;:\".[]]))|[([^\[\]\r\\]|\.)
](?:(?:\r\n)?[ \t]))(?:.(?:(?:\r\n)?[ \t])(?:[^()<>@,;:\\".\[\] \000-\031]+
(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[["()<>@,;:\".[]]))|[([^\[\]\r\\]|\.)](?: