Skip to content

Instantly share code, notes, and snippets.

View ErikCH's full-sized avatar
🏠
Working from home

Erik Hanchett ErikCH

🏠
Working from home
View GitHub Profile
@ErikCH
ErikCH / Readme.md
Last active October 17, 2018 04:45

Steps to install Amplify on your project from Program With Erik YouTube Channel

  • npm install -g @aws-amplify/cli

  • amplify configure

  • npm i aws-amplify

  • npm i aws-amplify-vue

  • amplify init

  • amplify add hosting

  • amplify publish

@ErikCH
ErikCH / gist:e9883d1fe70cdfda1e5a9e1adbcd1a9a
Created February 8, 2019 05:24
Vue 2.6 slots tutorial
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>My Test App</title>
<script src="https://unpkg.com/vue"></script>
</head>
<body>
@ErikCH
ErikCH / switch.js
Created February 20, 2019 05:56
Alternative To Switch Statements
//Program With Erik
const games = ['legend', 'pokemon', 'fortnite', 'blah']
games.forEach(val=> {
if(val === 'legend'){
console.log('legends')
} else if(val === 'pokemon') {
@ErikCH
ErikCH / func.js
Created July 3, 2019 03:53
Function File for new Vue Function API
import Vue from 'vue';
import { plugin } from 'vue-function-api';
import { value } from 'vue-function-api';
Vue.use(plugin);
export const counter = value(0);
export const image = value('');
export const pressMe = () => {
@ErikCH
ErikCH / Home.vue
Created July 3, 2019 03:54
home component for new Vue function API
<template>
<div class="home">
<h1>Random Dog Images</h1>
<h2>Dog Count {{counter}}</h2>
<button @click="getDog">Get Dogs</button>
<div class="dog-wrapper">
<div class="picture-dog">
<img :src="image" alt />
</div>
<button v-on:click="pressMe">Increment Dog Count</button>
@ErikCH
ErikCH / vue3
Created February 10, 2020 04:15
<div id="app"></div>
<script src="vue.global.js"></script>
<script>
const MyComponent = {
data: {
name: 'Erik'
},
template: `<h1>{{ name }}</h1>`
}
<body>
<div id="app">
<div class="nes-container with-title is-centered">
<p class="title">Vue Form Test</p>
<form @submit.prevent="submit">
<div class="nes-field">
<label for="name_field">Character Name</label>
<input placeholder="Enter name here" type="text"
name="name"
id="name_field" class="nes-input" />
@ErikCH
ErikCH / App.vue
Created January 2, 2022 23:24
For YT video on watchEffect vs Watch -> https://www.youtube.com/watch?v=QkadKspKoJo
<script setup>
import { watchEffect, ref, computed, watch } from "vue";
import { useRoute } from "vue-router";
const route = useRoute();
const welcome = ref("Hello!");
const count = ref(0);
const count2 = ref(0);
// Writes to a pre tag (Like console.log)
const write = ref("");
<script setup lang="ts">
import { ref, useSlots, getCurrentInstance } from "vue";
const props = defineProps<{ url: string }>();
const slots = useSlots();
let res = ref("");
let loading = ref(true);
fetch(props.url)