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
class ScrapingClient extends AbstractAggregationClient { | |
// | |
// Extending life cycle hooks | |
// | |
protected beforeAggregation(params): void { | |
// Calling superclass implementation to do some common preparation | |
super.beforeAggregation(params); | |
// Initialize Chrome instance for scraping |
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
abstract class AbstractAggregationClient { | |
constructor(private readonly options) {} | |
// | |
// Public interface | |
// | |
public getAccounts(params): AggregationResult { | |
try { | |
// Preparation step |
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
class AggregationService { | |
constructor(private readonly clientFactory: AggregationClientFactory) {} | |
public processRequest(request: AggregationRequest): void { | |
const client = this.clientFactory.createClient(request.serviceName); | |
if (request.type === "getAccounts") { | |
const result = client.getAccounts(); | |
// Save result | |
} |
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
<script lang="ts"> | |
export default Vue.extend({ | |
watch: { | |
saas: { | |
immediate: true, | |
handler(value): void { | |
if (value) { | |
// Clear current attr values | |
this.clearFormAttributes(); | |
// Initialize form attributes for new service, note that we must use $set to preserve Vue reactiviy on `form` object |
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
<script lang="ts"> | |
import Vue, { PropType } from "vue"; | |
import { requiredIf } from "vuelidate/lib/validators"; | |
export default Vue.extend({ | |
validations() { | |
const form: { [rule: string]: any } = {}; | |
this.allAttributes.forEach(attr => { | |
form[attr] = { | |
required: requiredIf(function(this: any): boolean { |
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
<template> | |
<div> | |
<form ref="form" class="mt-4" autocomplete="off" @submit.stop.prevent="handleSubmit"> | |
<div v-for="attr in allAttributes" :key="attr"> | |
<form-input-integration | |
v-model="$v.form[attr].$model" | |
:attribute-name="attr" | |
:state="validateForm(attr)" | |
/> | |
</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
<template> | |
<div> | |
<form ref="form" class="mt-4" autocomplete="off" @submit.stop.prevent="handleSubmit"> | |
<div v-for="attr in allAttributes" :key="attr"> | |
<form-input-integration | |
v-model="$v.form[attr].$model" | |
:attribute-name="attr" | |
:state="validateForm(attr)" | |
/> | |
</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
class Solution { | |
int width; | |
int height; | |
Queue<Point> q; | |
HashSet<Integer> h; | |
class Point { | |
int x; |
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
class Solution { | |
public boolean isSubsequence(String s, String t) { | |
if (s.isEmpty()) { | |
return true; | |
} | |
int lastBreak = 0; | |
int sIndex = 0; | |
int tIndex = 0; | |
int sLength = s.length(); |
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
class Solution { | |
private int symbolValue(char ch) { | |
switch (ch) { | |
case 'I': | |
return 1; | |
case 'V': | |
return 5; | |
case 'X': | |
return 10; | |
case 'L': |
NewerOlder