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 { EventEmitter } from '@angular/core' | |
import { | |
FormGroup, | |
AbstractControl, | |
ValidatorFn, | |
AbstractControlOptions, | |
AsyncValidatorFn | |
} from '@angular/forms' | |
/** |
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
export async function getIpMeta(ipAddr) { | |
try { | |
const url = `http://api.ipstack.com/${ipAddr}?access_key=youraccesskey` | |
const result = await request.get(url, { | |
headers: { 'content-type': 'application/json; charset=utf-8' } | |
}) | |
return JSON.parse(result) | |
} catch (e) { | |
console.error('error', e) | |
return undefined |
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 { Observable } from 'rxjs' | |
import moment from 'moment' | |
export const isEmpty = (obj) => { | |
return !obj || Object.keys(obj).length === 0 | |
} | |
export const isObservable = (obj: any) => { | |
return obj instanceof Observable | |
} |
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 { Observable } from 'rxjs' | |
import { HttpClient, HttpHeaders, HttpEvent } from '@angular/common/http' | |
import { environment } from '../../../environments/environment' | |
import { IApiResult } from '../interfaces/api-result.interface' | |
import { tap, map } from 'rxjs/operators' | |
@Injectable() | |
export class ApiService { |
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
export const environment = { | |
api: 'http://yourapi.com' | |
} |
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
""" | |
Downloads folders from github repo | |
Requires PyGithub | |
pip install PyGithub | |
""" | |
import os | |
import sys | |
import base64 | |
import shutil |