Skip to content

Instantly share code, notes, and snippets.

View vitaliy-kravchenko-dev's full-sized avatar

Vitaliy Kravchenko vitaliy-kravchenko-dev

View GitHub Profile
@vitaliy-kravchenko-dev
vitaliy-kravchenko-dev / webpack_tips.md
Created October 4, 2019 07:48
Webpack useful notes
@vitaliy-kravchenko-dev
vitaliy-kravchenko-dev / local-tunnel-packages.md
Last active September 12, 2019 14:58
Local tunnel (check OpenGraph)

ngrok

Install

  1. Install package https://dashboard.ngrok.com/get-started
  2. Run package with proper port for forwarding ./ngrok https 8000
  3. Run you local web server
    For Webpack do not forget to disable host check --disable-host-check
  4. Check your website within generated hostname

Increase memory limit for Node.js

Unix

export NODE_OPTIONS=--max_old_space_size=4096
# list all variables
printenv 

Windows

set NODE_OPTIONS=--max_old_space_size=4096
@vitaliy-kravchenko-dev
vitaliy-kravchenko-dev / console-save.js
Created April 26, 2019 15:41
Extend Console object with new Save function.
// Source
// http://bgrins.github.io/devtools-snippets/#console-save
(function(console){
console.save = function(data, filename){
if(!data) {
console.error('Console.save: No data')
return;
@vitaliy-kravchenko-dev
vitaliy-kravchenko-dev / apps-list.md
Last active October 29, 2018 14:44
Useful solutions
@vitaliy-kravchenko-dev
vitaliy-kravchenko-dev / cmd_commands.md
Last active August 6, 2018 12:06
Find process who blocks port
netstat -a -n -o | find "443"
tasklist /svc /FI "PID eq 37400"
@vitaliy-kravchenko-dev
vitaliy-kravchenko-dev / git_usefull_command.md
Last active April 30, 2019 10:25
Git & NPM- Useful commands

Clean up already merged branches

Local cleaning

git branch -r --merged | egrep -v "(^\*|master|dev|release|staging)" | xargs git branch -d

Remove local branches which don't have remote origin

git fetch -p && for branch in `git branch -vv | grep ': gone]' | awk '{print $1}'`; do git branch -D $branch; done Found on Stackoverflow - https://stackoverflow.com/a/33548037

Remote delete

git branch -r --merged | egrep -v "(^\*|master|dev|release|staging)" | sed 's/origin\///' | xargs -n 1 git push --delete origin

@vitaliy-kravchenko-dev
vitaliy-kravchenko-dev / goggle-maps-extract-city-country.js
Created May 17, 2018 13:46
Extract city and country from Google maps API response - geocoder.geocode()
getCityCountry(results) {
const location: any = {};
for (const component of results[0].address_components) {
if (component.types.includes('sublocality') || component.types.includes('locality')) {
location.city = component.long_name;
} else if (component.types.includes('administrative_area_level_1')) {
location.state = component.short_name;
} else if (component.types.includes('country')) {
location.country = component.long_name;
@vitaliy-kravchenko-dev
vitaliy-kravchenko-dev / npm_readme.md
Last active May 16, 2018 13:39
NPM usefull commands

Show list of dependencies with versions

npm list --depth=0

Show list of outdated dependencies with versions

npm outdated --depth=0