Skip to content

Instantly share code, notes, and snippets.

View vkiranmaniya's full-sized avatar
🇮🇳
Focusing

Kiran Maniya vkiranmaniya

🇮🇳
Focusing
View GitHub Profile
@vkiranmaniya
vkiranmaniya / Vue.js and Vuex - Best practises to save hours of effort.md
Created January 31, 2023 06:40
Vue.js and Vuex - Best practises to save hours of effort

Vue.js and Vuex - Best practises to save hours of effort

Modifying state object

Example

If you have to extend an existing object with additional property, always prefer Vue.set() over Object.assign() (or spread operator).

Example below explains implications for different implementations.

name: ElectronCI Workflow
on: [push]
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
@vkiranmaniya
vkiranmaniya / firebase-rules.json
Created September 2, 2021 08:36
Common rules for firebase
// No security, complete access allowed
{
"rules": {
".read": true,
".write": true
}
}
// Fully secured
{
import React, { Component } from 'react';
export const withErrorBoundary = WrappedComponent => (
class extends Component {
constructor(props) {
super(props);
this.state = { error: null, errorInfo: null };
}
componentDidCatch = (error, errorInfo) => catchFunc(error, errorInfo, this)
@vkiranmaniya
vkiranmaniya / .gitlab-ci.yml
Created September 15, 2019 06:58 — forked from ChugunovRoman/.gitlab-ci.yml
Deploy Electron app with gitlab ci
# https://<example.com>/<namespace>/<project>/-/jobs/artifacts/<tag>/download?job=pages
# https://<example.com>/<namespace>/<project>/-/jobs/artifacts/<tag>/raw/<path_to_file>?job=pages
# Where:
# example.com - domain name your gitlab server
# namespace - your name user on the gitlab
# project - your project
# tag - ref of current job.
# If job run on only by tags, than ref will be named as tag name
# If job run on only master, than ref will be named as "master", i.e.: https://<example.com>/<namespace>/<project>/-/jobs/artifacts/master/download?job=pages
# path_to_file - path to file relative from root workspace folder