Skip to content

Instantly share code, notes, and snippets.

View dima716's full-sized avatar

Anikeychik Dmitry dima716

View GitHub Profile

Принципы разработки Амплифера

Тут перечислены не законы, последние слово всегда за здравым смыслом. Тут перечислены лишь направление, куда надо стремиться. Принципы, которые должны помочь, когда не знаешь, что выбрать.

Ценности

  1. Пользователь. Если что-то сильно мешает UX или есть критическая ошибка, то в первую очередь мы спасаем пользователей. Для этого иногда надо взять ответственность на себя, переубедить толпу, написать плохой код.

Онбординг фронтендера на Амплифере

Дать доступ. Менеджер и Макс даёт доступ. Фронтовый тимлид пинает их, уточняет у нового фронтендера дали ли ему все доступы, пинаем ещё раз, если надо.

  1. Выдать почту на @amplifr.com
  2. Доступ в Slack
  3. Доступ в Trello
  4. Доступ в GitHub
  5. Доступ в Zeplin
  6. Доступ в Sentry
@dima716
dima716 / untilDestroyed.ts
Created May 17, 2019 10:34 — forked from ThomasBurleson/untilDestroyed.ts
Using untilViewDestroyed to link component ngOnDestroy to observable unsubscribe.
/**
* When manually subscribing to an observable in a view component, developers are traditionally required
* to unsubscribe during ngOnDestroy. This utility method auto-configures and manages that relationship
* by watching the DOM with a MutationObserver and internally using the takeUntil RxJS operator.
*
* Angular 7 has stricter enforcements and throws errors with monkey-patching of view component life-cycle methods.
* Here is an updated version that uses MutationObserver to accomplish the same goal.
*
* @code
*
@dima716
dima716 / demo.ts
Created May 7, 2018 09:22 — forked from shlomiassaf/demo.ts
RxJS cached polling operator with cache invalidation support in 10 LOC.
const reset$ = new Subject();
// the API call we want to poll
const poller$ = myApi.getData()
.pipe(poll(reset$, 30000)); // 30 secs
// no polling yet...
const sub1 = poller$.subsbribe(data => console.log('POLL TICK 1') );
const sub2 = poller$.subsbribe(data => console.log(' & 2') );
@dima716
dima716 / demo.ts
Created May 7, 2018 09:22 — forked from shlomiassaf/demo.ts
RxJS cached polling operator with cache invalidation support in 10 LOC.
const reset$ = new Subject();
// the API call we want to poll
const poller$ = myApi.getData()
.pipe(poll(reset$, 30000)); // 30 secs
// no polling yet...
const sub1 = poller$.subsbribe(data => console.log('POLL TICK 1') );
const sub2 = poller$.subsbribe(data => console.log(' & 2') );
const getJSON = data => data.json;
this.shopapiservice.get_locations()
.then(getJSON(response))
// не увидел где и для чего используется locations ?
.then(() => this.shopapiservice.render_task(this.video_render_task_id))
.then(response => getJSON(response).videos[0].video_id)
.then(video_id => this.shopapiservice.get_video(video_id))
.then(response => getJSON(response).picture)
.then(video_thumbnail => this.shopapiservice.create_campaign(
@dima716
dima716 / app-material.module.ts
Created October 10, 2017 11:58
Material module
import { NgModule } from '@angular/core';
import {
MdButtonModule,
MdCardModule,
MdCheckboxModule,
MdIconModule,
MdInputModule,
MdListModule,
MdSidenavModule,
MdToolbarModule
@dima716
dima716 / rescue-from-git-push-force.md
Created August 27, 2017 15:53 — forked from Envek/rescue-from-git-push-force.md
Откат ошибочной команды git push --force

Откат ошибочной команды git push --force

Иногда при работе с несколькими удалёнными репозиториями в git, может произойти страшное: git push --force в не тот remote и/или не в ту ветку.

Такое может случиться, например, если вы используете [Deis], в котором деплой запускается при git push нужного коммита в сборщик, когда при отладке деплоя после очередного git commit --amend по запарке вместо git push deis master --force делается просто git push --force. Упс.

Как результат, последние коммиты коллег безвозвратно потеряны, и вы чувствуете неотвратимость их ярости…

Но это git, а значит всё можно починить!

@dima716
dima716 / rescue-from-git-push-force.md
Created August 27, 2017 15:53 — forked from Envek/rescue-from-git-push-force.md
Откат ошибочной команды git push --force

Откат ошибочной команды git push --force

Иногда при работе с несколькими удалёнными репозиториями в git, может произойти страшное: git push --force в не тот remote и/или не в ту ветку.

Такое может случиться, например, если вы используете [Deis], в котором деплой запускается при git push нужного коммита в сборщик, когда при отладке деплоя после очередного git commit --amend по запарке вместо git push deis master --force делается просто git push --force. Упс.

Как результат, последние коммиты коллег безвозвратно потеряны, и вы чувствуете неотвратимость их ярости…

Но это git, а значит всё можно починить!

@dima716
dima716 / make-git-use-sublime.markdown
Created June 9, 2016 12:42 — forked from geekmanager/make-git-use-sublime.markdown
Making git use Sublime Text for rebase etc

Making git use Sublime Text

First up, let's make Sublime Text 2 available from the command line in terminal, by creating a link to subl which is the launcher from terminal:

ln -s /Applications/Sublime\ Text\ 2.app/Contents/SharedSupport/bin/subl /usr/local/bin/sublime

(added bonus of this approach is when you upgrade to ST3 or change text editor, you can just redirect the symlink).

If there's any chance that bash doesn't check usr/local/bin then use [Launch Sublime Text 2 from Mac OSX Terminal] for more detailed instructions on how to make this happen.