This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var { URL, URLSearchParams } = require('url'); | |
var request = require('request-promise-native'); | |
var _ = require('lodash'); | |
/** | |
* PornHUB adapter | |
* | |
* @url https://www.hubtraffic.com/resources/api?site_id=3 | |
* | |
* - searchVideos https://www.hubtraffic.com/resources/api?site_id=3#searchVideos |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const Joi = require('joi'); | |
module.exports = Joi.extend([ | |
{ | |
base: Joi.string(), | |
name: 'string', | |
language: { | |
objectid: 'needs to be a valid object id', | |
sha: 'needs to be a valid sha string' | |
}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
upstream webpack_dev_server { | |
server 127.0.0.1:4200; | |
} | |
server { | |
listen 443 ssl default_server http2; | |
ssl_certificate ...; | |
ssl_certificate_key ...; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { QueryEncoder, URLSearchParams } from '@angular/http'; | |
import { AppConfig } from '../../app/app.config'; | |
/** | |
* PHP's urlencode replaces `+` with ` ` while encodeURI in js does not touch `+`. | |
* | |
* @link http://php.net/manual/en/function.urlencode.php | |
* @link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/encodeURI | |
* @link https://angular.io/docs/ts/latest/api/http/index/URLSearchParams-class.html | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Component, OnInit, ViewEncapsulation, Renderer } from '@angular/core'; | |
import { ActivatedRoute } from '@angular/router'; | |
import { PartnerModel } from '../../../shared/models/partner.model'; | |
import { ViewModel } from '../../../shared/models/view.model'; | |
import { IDatatableCol, IDatatableConf } from '../../../shared/interfaces/shared.interface'; | |
import { DatatableComponent } from '../../../shared/components/datatable/datatable.component'; | |
@Component({ | |
selector: 'app-partner-list', | |
encapsulation: ViewEncapsulation.None, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="form-group" [ngClass]="{'has-danger': feedback && !state.valid && !state.control.pristine }"> | |
<label *ngIf="label" class="form-control-label">{{label}}</label> | |
<ng-content></ng-content> | |
<div *ngIf="feedback && !state.valid && !state.pristine"> | |
<div *ngIf="state.hasError('required')" class="form-control-feedback" [innerHTML]="'FORM.ERR_REQUIRED' | translate"></div> | |
<div *ngIf="state.hasError('minlength')" class="form-control-feedback" [innerHTML]="'FORM.ERR_MINLENGTH' | translate:({v: state.getError('minlength').requiredLength})"></div> | |
<div *ngIf="state.hasError('maxlength')" class="form-control-feedback" [innerHTML]="'FORM.ERR_MAXLENGTH' | translate:({v: state.getError('maxlength').requiredLength})"></div> | |
<div *ngIf="state.hasError('incorrectFileExtension')" class="form-control-feedback" [innerHTML]="'FORM.ERR_FILEEXTENSION' | translate:({v: state.getError('incorrectFileExtension').requiredFileExtension})"></div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Injectable } from '@angular/core'; | |
import { BehaviorSubject, Subscription } from 'rxjs'; | |
import { get, set, assign, merge, isEmpty } from 'lodash'; | |
export interface IStateOpts { | |
initState?: Object; | |
} | |
@Injectable() | |
export class StateS { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// credits: https://github.com/SebastianM/angular2-google-maps/blob/master/src/core/services/maps-api-loader/lazy-maps-api-loader.ts | |
import { Injectable } from '@angular/core'; | |
import { isEmpty } from 'lodash'; | |
let _callbacks = 0; | |
/** | |
* Configuration for the {@link ScriptLoader}. | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { ValidatorFn, AbstractControl } from '@angular/forms'; | |
/** | |
* All file sizes specified in bytes. | |
*/ | |
export function emailValidator(): ValidatorFn { | |
return (control: AbstractControl): {[key: string]: any} => { | |
const re = /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/; | |
const passed = re.test(control.value); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Injectable } from '@angular/core'; | |
import { BehaviorSubject, Subscription } from 'rxjs'; | |
import { get, set, assign, merge, isEmpty } from 'lodash'; | |
import { IS_DEV } from '../constants'; | |
import { ResMsgHandlerS } from './res-msg-handler.s'; | |
export interface IStateOpts { | |
initState?: Object; | |
} |
NewerOlder