Here is a simple and robust way to check for the validity of an email address syntax directly in the browser. No need for crazy regular expressions.
e = document.createElement('input')
e.type = 'email'
// check some email addresses
e.value = 'hi@'
const extractTLD = (href = window.location.href) => { | |
const url = new URL(href); | |
return url.hostname.split('.').slice(-2).join('.'); | |
} | |
export default extractTLD; |
{ | |
"/myapp/*": { | |
"target": "https://pedro.internal.lab:9443", | |
"secure": false, | |
"logLevel": "debug", | |
"changeOrigin": true | |
}, | |
"/users/*": { | |
"target": "https://sonia.internal.lab:9443", | |
"secure": false, |
import { TestBed, ComponentFixture } from '@angular/core/testing'; | |
import { CapitalizeDirective } from './capitalize.directive'; | |
import { Component, HostListener } from '@angular/core'; | |
// Simple test component that will not in the actual app | |
@Component({ | |
template: '<p dtCapitalize>Testing Directives is awesome!</p>' | |
}) | |
class TestComponent { | |
// clickCount is not necessary but it's used here to verify that the component |
import { Directive, HostListener, ElementRef } from '@angular/core'; | |
@Directive({ | |
selector: '[dtCapitalize]' | |
}) | |
export class CapitalizeDirective { | |
constructor(private el: ElementRef) { } | |
@HostListener('click') | |
onClick() { |
import hudson.model.* | |
def env = build.getEnvironment() | |
def gitCommit = env['GIT_COMMIT'] | |
def shortGitCommit = gitCommit[0..6] | |
def pa = new ParametersAction([ | |
new StringParameterValue("SHORT_GIT_COMMIT", shortGitCommit) | |
]) |
/* | |
Quick instructions: | |
1. Go to Google Docs and open a new spreadsheet. | |
2. Go to Tools > Script editor... | |
3. Delete everything, paste this code in the script editor, and save it. | |
4. Go back to the spreadsheet, Tools > Script manager... | |
5. Select getChats, and press the "run" button. | |
6. It'll ask for a bunch of authorizations. Grant them. | |
7. When it says "now you can run the script", repeat step 5. |
# Product Name | |
> Short blurb about what your product does. | |
[![NPM Version][npm-image]][npm-url] | |
[![Build Status][travis-image]][travis-url] | |
[![Downloads Stats][npm-downloads]][npm-url] | |
One to two paragraph statement about your product and what it does. | |
![](header.png) | |
## Installation | |
OS X & Linux: | |
```sh |
Here is a simple and robust way to check for the validity of an email address syntax directly in the browser. No need for crazy regular expressions.
e = document.createElement('input')
e.type = 'email'
// check some email addresses
e.value = 'hi@'
Following our series on HTTP, here is a quick note on HTTP status code, sent with the HTTP response. They are organized in 5 categories:
1xx Informational, ex:
100 Continue
used when doing a multi-part file upload101 Switching Protocol
used when switching from HTTP to WebSocket2xx Success, ex: