Skip to content

Instantly share code, notes, and snippets.

View gearmobile's full-sized avatar
🇷🇺
Working remotely

Valery Semenenko gearmobile

🇷🇺
Working remotely
View GitHub Profile
@gearmobile
gearmobile / remove-node_modules.txt
Last active June 17, 2021 06:36 — forked from S-Voss/remove-node_modules.txt
Remove node_modules after pushing to git repository
# add 'node_modules' to .gitignore file
git rm --cached node_modules
git commit -m 'Added node_modules to .gitignore file. Also removed node_modules from git tracking and repository.'
git push origin master
@gearmobile
gearmobile / update_branch_list_from_remote.sh
Created May 1, 2021 17:43 — forked from dhonx/update_branch_list_from_remote.sh
Git: Update Branch List from Remote
# Source: https://stackoverflow.com/questions/36358265/when-does-git-refresh-the-list-of-remote-branches
# To update the local list of remote branches:
git remote update origin --prune
@gearmobile
gearmobile / file.ts
Created February 3, 2021 07:59
Найти вхождение элементов одного массива в другом массиве и удалить их оттуда
let arr1 = [1,2,3,4,5];
const arr2 = [4,5];
arr1 = arr1.filter(el => !arr2.includes(el));
console.log(arr1);
@gearmobile
gearmobile / app.component.html
Created September 3, 2020 07:23
Angular - Call child component method from parent
<button (click)="callChild()"> Call child </button>
<button (click)="childcomp.sayHello()"> Call child from view</button>
<app-comp-a #childcomp ></app-comp-a>
@gearmobile
gearmobile / async validation with debounce
Created April 14, 2020 06:07 — forked from ellipizle/async validation with debounce
async validation with debounce listening to value change
import { Component, OnInit } from '@angular/core';';
import { FormBuilder, FormGroup, Validators, AbstractControl, ValidationErrors } from '@angular/forms';
import { Router } from '@angular/router'
import { CommonValidators } from '../service/CommonValidator';
import { Response } from '@angular/http';
import { Observable } from 'rxjs/Observable';
import { GlobalService } from '../../shared/service/global.service';
import { AuthHttp } from 'angular2-jwt'
declare var $: any;
import 'rxjs/add/operator/delay';
https://stackoverflow.com/questions/34948961/angular-2-custom-form-input/34998780#34998780
https://stackoverflow.com/questions/50618050/how-to-create-custom-input-component-with-ngmodel-working-in-angular-6
https://rangle.io/blog/angular-2-ngmodel-and-custom-form-components/
https://blog.thoughtram.io/angular/2016/07/27/custom-form-controls-in-angular-2.html
https://blog.angulartraining.com/tutorial-custom-form-controls-with-angular-22fc31c8c4cc
https://medium.com/@lukaonik/how-to-write-custom-form-controls-in-angular-1285ed00bba0
https://netbasal.com/angular-custom-form-controls-made-easy-4f963341c8e2

Download Audio from YouTube

-i - ignore errors

-c - continue

-t - use video title as file name

--extract-audio - extract audio track

@gearmobile
gearmobile / settings.js
Last active July 27, 2019 06:15
VSC Sync Settings
class Map extends React.Component {
constructor(props) {
super(props);
this.state = {
center: null,
points: [],
zoom: 1,
numberToShowMap: 0
};
}
class Site extends React.Component {
constructor(props) {
super(props);
this.state = {
offices: []
};
this.getOffices = this.getOffices.bind(this);
}
const App = () => (
<main className="container">
<Site />
</main>
);