软糖

Candy


  • Home

  • Archives

  • Tags

  • Search
close
软糖

kubernetes intro day 1

Posted on 2019-05-13 |

Initializing the Master

Calico networking plugin

1
2
3
kubeadm init --pod-network-cidr 192.168.0.0/16 \
--service-cidr 10.96.0.0/16 \
--apiserver-advertise-address $(ifconfig ens160 | grep 'inet addr'| cut -d':' -f2 | awk '{print $1} ')

Calico Project

1
kubectl apply -f http://docs.projectcalico.org/v2.3/getting- started/kubernetes/installation/hosted/kubeadm/1.6/calico.yaml

Tips

1
echo "source <(kubectl completion bash)" >> ~/.bashrc
软糖

Elastic Search Step by Step 1

Posted on 2019-04-28 |

This is follow up Elastic Search - Getting Start Post

More details and step by step instruction

Read more »
软糖

Oracle 12c workshop cheatsheet II

Posted on 2019-03-27 |

This is a cheat sheet for Oracle 12C R2 workshop Part II

Will conver those topics:

  • Storage space
  • Undo
  • Moving Data
  • Backup and Recovery
Read more »
软糖

Oracle 12c workshop cheatsheet

Posted on 2019-03-26 |

This is a cheat sheet for Oracle 12C R2 workshop Part I

Will conver those topics:

  • EM
  • CBD
  • PDB
  • Network
  • User Security
  • Tablespaces
Read more »
软糖

Elastic Search - Getting Start 3

Posted on 2019-02-12 |

1. Search API

  • sending search parameters through the REST request URI
  • sending search parameters through the REST request body
Read more »
软糖

Elastic Search - Getting Start 2

Posted on 2019-02-12 |

1. Health API

Health Check

1
curl -X GET "http://{{host}}:9200/_cat/health?v"
  • Green - everything is good (cluster is fully functional)
    • Note: When a cluster is red, it will continue to serve search requests from the available shards but you will likely need to fix it ASAP since there are unassigned shards.
  • Yellow - all data is available but some replicas are not yet allocated (cluster is fully functional)
  • Red - some data is not available for whatever reason (cluster is partially functional)
Read more »
软糖

Elastic Search - Getting Start 1

Posted on 2018-10-10 |

1. Overview

Upside

  • Easy to setup
  • Abstracts away low level
  • Scales beautifully
  • Feature rich (out of box)

Downside

  • Poorly managed indeces
  • Inefficient queries
  • Web facing clasters
  • Used as primary data store

Elasticsearch is Robust, Highly Available, Distributed Search and Analytics Engine.

Read more »
软糖

老人节

Posted on 2018-05-07 |

2018年05月07日

饭桌上大家讨论旅游日期
妈妈说:“五月有什么节”
“母亲节,momerial day”, 我回答道
Zoe赶紧插话问:“有儿童节日吗”
我们一口同声, ”有啊“
我装可怜的说:“妈妈有母亲节,宝宝有儿童节,都没有爸爸的节日”
Zoe一脸嫌弃的回答:“你可以过老人节啊”

软糖

Vue2-4 template

Posted on 2018-04-10 |

Template slot

1
2
3
4
5
6
7
8
9
10
11
12
13
14
<!DOCTYPE html>
<html>
<body>
<div id="root">
<task>
<template slot="title">hello</template>
this will go to nameless slot tag
</task>
</div>
<script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
<script src="./order.js"></script>
</body>
</html>
1
2
3
4
5
6
7
8
9
10
11
Vue.component('task', {
template: `
<li>
<slot name="title"></slot>
<slot>Default content</slot>
</li>`
})
new Vue({
el: '#root',
})

Note: template tag will be deleted when rendered in html page

1
2
3
<div id="root">
<task><li>hello</li></task>
</div>

Note: other tag will be kept.

Inline template

1
2
3
4
5
6
7
8
9
10
11
12
13
<!DOCTYPE html>
<html>
<body>
<div id="root" class="container">
<progress-view inline-template>
<h1>Your progress is {{ completionRate }}</h1>
</progress-view>
</div>
<script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
<script src="./order.js"></script>
</body>
</html>
软糖

Vue2-3 event

Posted on 2018-04-09 |

Simple Example

Please look at this.$emit() method. and how we use it to notify the parent view.

Basically, the notification path is

input @blur -> applied method -> $emit applied event -> coupon @applied -> onCouponApplied method

1
2
3
4
5
6
7
8
9
10
11
12
<!DOCTYPE html>
<html>
<body>
<div id="root">
<coupon @applied="onCouponApplied"></coupon>
<h1 v-if="couponApplied">You used a coupon</h1>
</div>
<script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
<script src="./order.js"></script>
</body>
</html>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
Vue.component('coupon', {
template: `<input placeholder="Enter code" @blur="applied">`,
methods: {
applied() {
this.$emit('applied')
},
},
})
new Vue({
el: '#root',
data: {
couponApplied: false,
},
methods: {
onCouponApplied() {
this.couponApplied = true
},
}
})

Send/Listen event by shared instance

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
window.Event = new Vue()
Vue.component('coupon', {
template: `<input placeholder="Enter code" @blur="applied">`,
methods: {
applied() {
Event.$emit('applied')
},
},
})
new Vue({
el: '#root',
data: {
couponApplied: false,
},
created() {
Event.$on('applied', () => alert('Handling'))
}
})
123…6
Steven Zhang

Steven Zhang

Java, Haskell and Architecture

57 posts
23 tags
GitHub
© 2016 - 2020 Steven Zhang
Powered by Hexo
Theme - NexT.Mist