Skip to content

Instantly share code, notes, and snippets.

View beardlessman's full-sized avatar

Dmitrii Mungalov beardlessman

View GitHub Profile
@beardlessman
beardlessman / webpack.banner.js
Created April 17, 2018 04:50 — forked from kevinSuttle/webpack.banner.js
Webpack auto-injecting banner into each file
const pkg = require('./package.json');
const moment = require('moment');
const localTimeZone = Intl.DateTimeFormat().resolvedOptions().timeZone
const timeStamp = moment().format('LLLL');
const banner = `
Generated on ${timeStamp} - ${localTimeZone}
Description: ${pkg.description}
Package: ${pkg.name}
Version: v${pkg.version}
Contributors: ${pkg.contributors.map(function(contributor){ return contributor})}
Удаляешь текущий
sudo apt-get purge code
Подключаем репозиторий MS
curl https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > microsoft.gpg
sudo mv microsoft.gpg /etc/apt/trusted.gpg.d/microsoft.gpg
sudo sh -c 'echo "deb [arch=amd64] http://packages.microsoft.com/repos/vscode stable main" > /etc/apt/sources.list.d/vscode.list'
Устанавливаешь пакетом
// дата '1.02.1927'
/(3[0-1]|2\d|1\d|0\d|\d).(1[0-2]|0\d|\d).(\d{4})/
@beardlessman
beardlessman / getChildInstance.js
Created June 22, 2018 08:42
REACT How to call child component method from parent
/* Child.js */
import React from 'react'
class Child extends React.Component {
componentDidMount() {
this.props.onRef(this)
}
componentWillUnmount() {
this.props.onRef(undefined)
}
@beardlessman
beardlessman / GIT-rename-branch
Created July 12, 2018 05:06
[Git] Переименование ветки (локально и удаленно)
git branch -m old_branch new_branch – переименовать локальную ветку
git push origin :old_branch – удалить старую ветку
git push --set-upstream origin new_branch – выгрузить новую ветку и "закрепить" ее за локальной веткой
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/redux/3.0.4/redux.js" /></script>
<script src="https://fb.me/react-0.14.0.js" /></script>
<script src="https://fb.me/react-dom-0.14.0.js" /></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/react-redux/4.0.0/react-redux.js" /></script>
UPDATE wp_options SET option_value = replace(option_value, 'http://www.example.com', 'http://localhost/test-site') WHERE option_name = 'home' OR option_name = 'siteurl';
UPDATE wp_posts SET post_content = replace(post_content, 'http://www.example.com', 'http://localhost/test-site');
UPDATE wp_postmeta SET meta_value = replace(meta_value,'http://www.example.com','http://localhost/test-site');
lsof -i tcp:8890 // порт
kill -9 16658 // id процесса
"prettier.singleQuote": true,
"prettier.trailingComma": "all",
"prettier.printWidth": 120,