Skip to content

Instantly share code, notes, and snippets.

View VisionYi's full-sized avatar
🦁
Learning !!

Vision Hung VisionYi

🦁
Learning !!
View GitHub Profile
@VisionYi
VisionYi / S3-Static-Sites.md
Created December 17, 2022 09:01 — forked from bradwestfall/S3-Static-Sites.md
Use S3 and CloudFront to host Static Single Page Apps (SPAs) with HTTPs and www-redirects. Also covers deployments.

S3 Static Sites

What this will cover

  • Host a static website at S3
  • Redirect www.website.com to website.com
  • Website can be an SPA (requiring all requests to return index.html)
  • Free AWS SSL certs
  • Deployment with CDN invalidation

Resources

<template>
name: <input type="text" v-model="nameSync">
year: <input type="number" v-model="yearSync">
</template>
<script>
export default {
//...
props: {
name: {
<template>
<div v-for="(item, index) in valueSync" :key="item.id">
name: <input type="text" v-model="item.name" @input="syncPropValue"> <!-- add event -->
years: <input type="number" v-model="item.years" @input="syncPropValue"> <!-- add event -->
<button @click="removePepole(index)">remove</button>
</div>
</template>
<script>
export default {
<template>
<div v-for="(item, index) in valueSync" :key="item.id">
name: <input type="text" v-model="item.name">
years: <input type="number" v-model="item.years">
<button @click="removePepole(index)">remove</button>
</div>
</template>
<script>
export default {
<script>
export default {
//...
watch: {
value: {
handler(value, oldValue) {
// 同步 value 與 valueSync
if (value !== this.valueSync) {
this.valueSync = value
}
<template>
<div v-for="(item, index) in valueSync" :key="item.id">
name: <input type="text" v-model="item.name" @input="syncPropValue">
years: <input type="number" v-model="item.year" @input="syncPropValue">
<button @click="removePepole(index)">remove</button>
</div>
</template>
<script>
export default {
@VisionYi
VisionYi / taiwan-district-zip-code.json
Last active July 3, 2019 10:48 — forked from abc873693/taiwan_districts.json
台灣行政區郵遞區號 JSON
[
{
"districts":[
{
"zip":"100",
"name":"中正區"
},
{
"zip":"103",
"name":"大同區"
@VisionYi
VisionYi / base-webpack.config.js
Last active April 14, 2020 14:30
Webpack 4 base configuration
const path = require('path');
const webpack = require('webpack');
const chokidar = require('chokidar'); // hot reload for html, webpack-dev-server has include this plugin.
const htmlWebpackPlugin = require('html-webpack-plugin');
const miniCssExtractPlugin = require("mini-css-extract-plugin");
const terserPlugin = require("terser-webpack-plugin"); // minify js
const optimizeCSSAssetsPlugin = require("optimize-css-assets-webpack-plugin");
const cleanWebpackPlugin = require('clean-webpack-plugin');
const devMode = process.env.NODE_ENV !== 'production';
@VisionYi
VisionYi / README.md
Created May 31, 2017 17:04 — forked from zenorocha/README.md
A template for Github READMEs (Markdown) + Sublime Snippet

Project Name

TODO: Write a project description

Installation

TODO: Describe the installation process

Usage

@VisionYi
VisionYi / README-Template.md
Created May 31, 2017 17:02 — forked from PurpleBooth/README-Template.md
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites