Skip to content

Instantly share code, notes, and snippets.

View malakhov-dmitrii's full-sized avatar

Dmitrii Malakhov malakhov-dmitrii

View GitHub Profile
git clone --bare https://bitbucket.org/durdn/cfg.git $HOME/.cfg
function config {
/usr/bin/git --git-dir=$HOME/.cfg/ --work-tree=$HOME $@
}
mkdir -p .config-backup
config checkout
if [ $? = 0 ]; then
echo "Checked out config.";
else
echo "Backing up pre-existing dot files.";
const adjustParams = (period) => {
const iter = 10;
const incr = 1 / iter;
let bestAlpha = 0.0;
let bestError = -1;
let alpha = bestAlpha;
let bestGamma = 0.0;
let gamma = bestGamma;
let bestDelta = 0.0;
let delta = bestDelta;
predict = (
data,
a = 0.95,
b = 0.4,
g = 0.2,
p = this.PERIODS_TO_PREDICT,
) => {
const alpha = a;
const beta = b;
const gamma = g;
@malakhov-dmitrii
malakhov-dmitrii / cloudSettings
Last active November 30, 2019 17:01
vscode config
{"lastUpload":"2019-11-30T17:01:31.171Z","extensionVersion":"v3.4.3"}
export class TodoComponent implements OnInit {
constructor(private _store: Store<State>) { }
ngOnInit() {
}
createTodo() {
// Или любой другой способ задать значения :)
let todo: Todo = {
import {Action} from "@ngrx/store";
export interface Todo {
title: string;
completed: boolean;
id: number;
userId: number;
}
export enum TodosActions {
ngOnInit() {
this.store.dispatch(new GetPosts());
}
import { Injectable } from '@angular/core';
import { Actions, Effect, ofType } from '@ngrx/effects';
import { EMPTY } from 'rxjs';
import { map, mergeMap } from 'rxjs/operators';
@Injectable()
export class MovieEffects {
@Effect()
loadMovies$ = this.actions$