Skip to content

Instantly share code, notes, and snippets.

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

Valeriy Semenenko gearmobile

🇷🇺
Working remotely
View GitHub Profile
@gearmobile
gearmobile / settings-visual-studio.txt
Last active November 3, 2017 06:32
Visual Code Studio - включение поддержки автокомплита в js-файлах React.js
You need to change syntax to JavascriptReact.
Also you can make this syntax project default for new js files by creating file:
.vscode/settings.json with following content:
{
"files.associations": { "*.js": "javascriptreact" }
}
@gearmobile
gearmobile / es6.js
Last active November 2, 2017 12:59
// -----------------------------
// export and import modules
// -----------------------------
// uno.js
const uno = {
value: 1
}
export default uno
// ---
@gearmobile
gearmobile / props.js
Created October 24, 2017 07:17
Vue.js Props with validation and default value via return function
props: {
value: {
type: Number,
default () { return 2 }
},
min: {
type: Number,
default () { return 1 }
},
max: {
const Home = () => import(/* webpackChunkName: "home" */ './Home.vue');
const About = () => import(/* webpackChunkName: "about" */ './About.vue');
const Contact = () => import(/* webpackChunkName: "contact" */ './Contact.vue');
const routes = [
{ path: '/', name: 'home', component: Home },
{ path: '/about', name: 'about', component: About },
{ path: '/contact', name: 'contact', component: Contact }
];
<template>
<modal v-model="show" effect="fade">...</modal>
</template>
<script>
import Modal from 'vue-strap/src/Modal.vue';
export default {
props: ['show'],
components: {
Modal
<template>
<div>
<div class="jumbotron">...</div>
<below-fold></below-fold>
<home-modal v-if="show" :show="show"></home-modal>
</div>
</template>
<script>
const BelowFold = () => import(
<template>
<div class="row marketing">
<div class="col-lg-6">
<h4>Subheading</h4>
<p>Donec id elit non mi porta gravida at eget metus. Maecenas faucibus mollis interdum.</p>
...
</div>
...
</div>
</template>
<template>
<div>
<div class="jumbotron">
<h1>Jumbotron heading</h1>
...
</div>
<below-fold></below-fold>
<!--All the code below here has been put into-->
<!--into the above component-->
<!--<div class="row marketing">
@gearmobile
gearmobile / updateMeetUp.js
Created September 10, 2017 17:03
Mutatiton for update existing object Meetup
'UPDATE_MEETUP' (state, payload) {
const sample = state.meetups.find(el => el.id === payload.id)
if (sample) {
if (payload.title) {
sample.title = payload.title
}
if (payload.description) {
sample.description = payload.description
}
if (payload.date) {
@gearmobile
gearmobile / downgrade_to_npm_5.3.0.txt
Created September 4, 2017 14:37
Откатить версию npm назад до 5.3.0
npm install -g [email protected]