Skip to content

Instantly share code, notes, and snippets.

View mjgartendev's full-sized avatar

Michael Garten mjgartendev

View GitHub Profile
@mjgartendev
mjgartendev / firebase-config.js
Last active May 29, 2018 03:04
Template to add firebase connection settings to vue project from https://www.smashingmagazine.com/2018/04/vuejs-firebase-firestore/
// Copied/simplified from https://www.smashingmagazine.com/2018/04/vuejs-firebase-firestore/
// by https://www.smashingmagazine.com/author/lukas-van-driel
// 1. npm install firebase
// 2. insert this snippet in your Vuex root
import Vue from 'vue';
import firebase from 'firebase/app';
import 'firebase/firestore';
// Copy this from the cloud console "add to web app" settings
var config = {
@mjgartendev
mjgartendev / firebase-hosting.md
Last active May 25, 2018 01:46
Steps are just copied from the firebase hosting page, but in markdown to follow along within a text editor

Google Firebase Hosting Steps

Install

Install Firebase tool globally

npm install -g firebase-tools
@mjgartendev
mjgartendev / cacher.snippetsAdd.md
Created May 25, 2018 02:17
markdown docs of Cacher CLI snippets:add command

Cacher Add Snipper CLI Commands

USAGE

cacher snippets:add [FILENAME]

OPTIONS

@mjgartendev
mjgartendev / MyComponent.vue
Created May 25, 2018 03:13
Basic Vue.js component using default languages.
<template>
<div>
</div>
</template>
<script>
export default {
@mjgartendev
mjgartendev / nuxt.config.js
Created May 25, 2018 04:36
An example nuxt.config.js file heavily commented from the nuxt and vue-meta documentation examples
module.exports = {
/*
Headers of the page
- Nuxt.js uses vue-meta to update the headers and html attributes of your application.
- Nuxt.js configures vue-meta with these options:
{
keyName: 'head', // the component option name that vue-meta looks for meta info on.
attribute: 'data-n-head', // the attribute name vue-meta adds to the tags it observes
ssrAttribute: 'data-n-head-ssr', // the attribute name that lets vue-meta know that meta info has already been server-rendered
tagIDKeyName: 'hid' // the property name that vue-meta uses to determine whether to overwrite or append a tag
@mjgartendev
mjgartendev / Page.vue
Created May 25, 2018 04:37
An example Nuxt Page component heavily commented from the Nuxt documentation
<template>
<div>
<!-- nuxt-child
For Nested Route Pages:
This component is used for displaying the children components in a nested route.-->
<div>
<h1>I am the parent view</h1>
<nuxt-child/>
</div>
@mjgartendev
mjgartendev / Layout.vue
Created May 25, 2018 04:38
An example Nuxt Layout component commented from the Nuxt documentation
<template>
<div>
<!-- nuxt
For Layouts:
<nuxt> component is used only in layouts to display the page components.
Props:
nuxtChildKey: string
This prop will be set to <router-view/>, useful to make transitions inside a dynamic page and different route.
Default: $route.fullPath
Example (layouts/default.vue):-->
@mjgartendev
mjgartendev / typescriptView.vue
Created May 28, 2018 23:45
Component for Vue pages/views using typescript and postcss
<template>
</template>
<script lang="ts">
import Vue from 'vue'
export default Vue.extend({
})
</script>