Skip to content

Instantly share code, notes, and snippets.

View vvscode's full-sized avatar
⌨️
Here is Rhodes, jump here!

Vasiliy Vanchuk vvscode

⌨️
Here is Rhodes, jump here!
View GitHub Profile
@vvscode
vvscode / loading-container-usage.ts
Created February 8, 2019 10:39
handle-api-call-state-nicely
<loading-container [loadable]="news$ | async">
<p *ngFor="let item of (news$ | async).entities">{{item}}</p>
</loading-container>
/*
'(', '{', '[' are called "openers".
')', '}', ']' are called "closers".
Write an efficient function that tells us whether input string's openers
and closers are properly nested.
Examples:
"{ [ ] ( ) }" -> true
"{ [ ( ] ) }" -> false
@vvscode
vvscode / Feedback.js
Created June 26, 2019 15:25
Add fallback to `any` / `unknown` in case of errors in generating `.d.ts`
import React, { Fragment } from 'react';
import PropTypes from 'prop-types';
import classnames from 'classnames';
import Link from '@tamm/ui-lib-link';
import Icon from '@tamm/ui-lib-icon';
import FeedbackModal from '@tamm/ui-lib-feedback-modal';
import nop from '@tamm/ui-lib-utils/nop';
import './Feedback.less';
import { STEP } from '@tamm/ui-lib-feedback-modal/FeedbackModal.const';
describe("EventRecommender", () => {
const EventRecommender = require('../app/EventRecommender');
let er;
beforeEach(() => {
er = new EventRecommender();
});
describe("addEvent", () => {
it("adds a new Event to the system", () => {
@vvscode
vvscode / otus_python_web_hometask_1.md
Created December 1, 2019 16:14 — forked from grepto/otus_python_web_hometask_1.md
OTUS - Web-разработчик на Python Задачи из чата первого занятия

Выведите все элементы, которые меньше 5.

l = [1, 2, 3, 4, 5, 6, 7]

result = [i for i in l if i < 5]

print(result)
@vvscode
vvscode / commit-message.js
Created January 17, 2020 06:44
commit-message.js
/**
* It takes commit message and append a branch name below
*/
const fs = require('fs');
const childProcess = require('child_process');
const commitMessageFile = process.argv[2];
/**
BEGIN TRANSACTION;
CREATE TABLE IF NOT EXISTS "posts_tags" (
"post_id" INTEGER,
"tag_id" INTEGER,
FOREIGN KEY("post_id") REFERENCES "posts"("id"),
FOREIGN KEY("tag_id") REFERENCES "tags"("id")
);
CREATE TABLE IF NOT EXISTS "posts" (
"id" INTEGER NOT NULL,
"title" VARCHAR(100),
@vvscode
vvscode / sum.test.js
Created February 24, 2020 13:28
Sum tests
describe("sum", function() {
it("функция", function() {
assert.isOk(typeof sum === "function");
});
it("по-умолчанию инициализируется нулем", function() {
assert.isOk(+sum() === 0);
});
it("инициализируется числом", function() {
assert.isOk(+sum(5) === 5);
});
@vvscode
vvscode / apply.test.js
Created February 28, 2020 13:34
apply tests for otus
alert(1);
@vvscode
vvscode / GoL in js.md
Last active October 4, 2020 14:43
# Заметки по операциям, для реализации игры "Жизнь"

Заметки по операциям, для реализации игры "Жизнь"

Работа с массивами

Создать массив

const arr1 = [];
const arr2 = [1, 2, 3];