Skip to content

Instantly share code, notes, and snippets.

View rightisleft's full-sized avatar

Jack Murphy rightisleft

View GitHub Profile
getDirtyStopwords(): boolean {
// a swl that is not in rswl
// a swl that is not in rswl AND not custom stopwords
const newUserGeneratedStopWordLiss: DTOStopWords[] = this.lens.stopWordLists.filter(swl => {
const rootMirror: DTOStopWordsRoot = this.lens.rootStopWords.find(rswl => rswl.uuid === swl.uuid);
return !rootMirror && swl.name !== 'Custom Stop Words';
});
if (newUserGeneratedStopWordLiss.length > 0) {
getDirtyStopwords(): boolean {
// a swl that is not in rswl
// a swl that is not in rswl AND not custom stopwords
const newUserGeneratedStopWordLiss: DTOStopWords[] = this.lens.stopWordLists.filter(swl => {
const rootMirror: DTOStopWordsRoot = this.lens.rootStopWords.find(rswl => rswl.uuid === swl.uuid);
return !rootMirror && swl.name !== 'Custom Stop Words';
});
if (newUserGeneratedStopWordLiss.length > 0) {
// this "shim" can be used on the frontend to prevent from errors on undefined
// decorators in the models, when you are sharing same models across backend and frontend.
// to use this shim simply configure your systemjs/webpack configuration to use this file instead of typeorm module.
// for system.js this resolved this way:
// System.config({
// ...
// packages: {
// "typeorm": {
// main: "typeorm-model-shim.js",
import {MigrationInterface, QueryRunner} from "typeorm";
export class GlobalStopwords1567444727548 implements MigrationInterface {
public english: string[] = ["able", "about", "above", "according", "accordingly", "across", "actually",
"after", "afterwards", "again", "against", "all",
"allow", "allows", "almost", "alone", "along", "already", "also", "although",
"always", "am", "among", "amongst", "an", "and", "another",
"any", "anybody", "anyhow", "anyone", "anything", "anyway", "anyways",
"anywhere", "apart", "appear", "appreciate", "appropriate", "are",
import {MigrationInterface, QueryRunner} from "typeorm";
export class GlobalStopwords1567444727548 implements MigrationInterface {
public english: string[] = ["able", "about", "above", "according", "accordingly", "across", "actually",
"after", "afterwards", "again", "against", "all",
"allow", "allows", "almost", "alone", "along", "already", "also", "although",
"always", "am", "among", "amongst", "an", "and", "another",
"any", "anybody", "anyhow", "anyone", "anything", "anyway", "anyways",
"anywhere", "apart", "appear", "appreciate", "appropriate", "are",
import {ObjectStoreInjectable} from "./objectStore.injectable";
import {Container} from "aurelia-dependency-injection";
import {HeadObjectOutput} from "aws-sdk/clients/s3";
export class SimpleFileState<T> {
private _assetId: string;
private _store: ObjectStoreInjectable;
public state: FileState<T>;
private _inFlight: boolean = false;
import {sleep} from "./sleep";
const RETRY_COUNT: number = 1000;
const RETRY_DELAY_INCREASE: number = 500;
export class ConnectionRetry {
private _isConnected: boolean = false;
private _connectionAttempts: number = 0;
private _retryDelay: number = 0;
import {DTOBase} from "./base.dto";
import {Column, CreateDateColumn, UpdateDateColumn} from "typeorm";
export class DTOClassification extends DTOBase {
@Column('integer')
public modelId: number;
@Column('integer')
public topicId: number;
{
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
"version": 1,
"newProjectRoot": "projects",
"projects": {
"web": {
"root": "",
"sourceRoot": "src",
"projectType": "application",
"architect": {
{
"name": "@pienso/pienso-navigation",
"version": "2.0.0",
"license": "MIT",
"scripts": {
"ng": "ng",
"start": "ng serve",
"build": "ng build",
"lint": "ng lint",
"dist": "ng-packagr -p ng-package.json",