Skip to content

Instantly share code, notes, and snippets.

@dmitriydementor
dmitriydementor / mpg.ts
Created July 12, 2019 10:38
generate angular material theme from only orimary and warn color
import { execSync } from 'child_process';
import { join } from 'path';
import { readFileSync, writeFileSync } from 'fs';
import * as sassExtract from 'sass-extract';
const materilPalettePath = './src/modules/common/style/angular-material';
const warnColor = '#ed1c24';
sassExtract.render({
file: `./src/modules/common/style/colors.scss`,
@dmitriydementor
dmitriydementor / forms.ts
Created June 3, 2019 19:17
Handy functions to manipulate forms in Angular
import { FormGroup, FormControl, FormArray } from '@angular/forms';
export function markFormGroupDirty(formGroup: FormGroup) {
(<any>Object).values(formGroup.controls).forEach((control: FormControl) => {
if (control instanceof FormArray) {
(control as FormArray).controls.forEach((c: FormGroup) => {
markFormGroupDirty(c);
});
} else {
control.markAsDirty();
camera = new THREE.PerspectiveCamera(75,window.innerWidth/window.innerHeight,0.1,10000);
camera.position.y = 150;
camera.position.z = 150;
scene = new THREE.Scene();
// texture
let manager = new THREE.LoadingManager();