Skip to content

Instantly share code, notes, and snippets.

View edmondyip's full-sized avatar

Edmond Yip edmondyip

View GitHub Profile
@edmondyip
edmondyip / index.vue
Created October 30, 2019 07:52
Threejs in Vue
<template lang="pug">
#three
</template>
<script>
export default {
mounted() {
this.init();
},
methods: {
@edmondyip
edmondyip / three.js
Last active October 30, 2019 04:34
Vue import Threejs plugins
import Vue from 'vue';
import * as THREE from 'three';
Vue.use({
install(Vue) {
Vue.protoype.$THREE = THREE;
}
});
@edmondyip
edmondyip / docker-compose.yml
Last active August 30, 2018 10:32
WordPress + PHP7 + MariaDB + Nginx + Let's Encrypt
version: '2'
services:
# Nginx Proxy Server, ports 都由他管理
nginx-proxy:
container_name: nginx-proxy
image: jwilder/nginx-proxy
restart: always
ports:
- "80:80"
routes:
/news/:
controller: channel
filter: 'tag:news'
data: tag.news
@edmondyip
edmondyip / routes.yml
Last active August 29, 2018 09:27
Ghost Dynamic Routing
routes:
collections:
/:
permalink: /{slug}/
template:
- index
taxonomies:
tag: /tag/{slug}/
@edmondyip
edmondyip / docker-compose.yml
Last active July 27, 2018 09:02
docker-compose ghost setting
version: '2' # docker-compose 的版本
services: # 以下就是服務,可以同時存放多個服務,運行時會一個個啟動
ghost: # service 的名,你可以改成任何不重覆的名稱
image: ghost:1.24.9-alpine # image 的版本,這裡我用了ghost v1.24.9 的輕量版
container_name: 256pages-blog # container 的名,在 docker 中都會見到這個而不是 service name
restart: always # 如果重新開機會自動重啟
ports: # 把 ghost 的 port 2368 mount 到 8080,8080 可以成其他
- '8080:2368'
volumes: # 因為我本身有舊的 ghost,所以把 content mount 到 ./blog 這位置
- './blog:/var/lib/ghost/content'
<script>
mounted: function () {
this.svgBg = new SVGMorpheus('#background-svg', {duration: 600, easing: 'circ-in', rotation: 'counterclock' })
this.target = this.$route.name
this.change()
}
</script>
<script>
methods: {
change: function () {
this.svgBg.to(this.target)
}
}
</script>
@edmondyip
edmondyip / Background.vue
Last active January 23, 2018 03:42
Data
<script>
import SVGMorpheus from "@/assets/svg-morpheus"
export default {
data: function () {
return {
target: this.$route.name,
svgBg: null,
svgList: [{
name: 'home',
path: ['M260,341V141H460V341Z']
@edmondyip
edmondyip / Background.vue
Created January 23, 2018 03:40
Import SVG Morpheus
<script>
import SVGMorpheus from "@/assets/svg-morpheus"
</script>