This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!doctype> | |
<html> | |
<div id="app"></div> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/vue/2.1.6/vue.js"></script> | |
<script> | |
// create single state instance | |
const state = { | |
value: 0 | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Observable, BehaviorSubject } from 'rxjs' | |
import axios from 'axios' | |
const API_URL = 'http://localhost:8080' | |
const API = { | |
get (url) { | |
return Observable.fromPromise(axios.get(API_URL + url)) | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<template lang="pug"> | |
.ui.checkbox | |
input(ref='input', type='checkbox') | |
label | |
slot | |
</template> | |
<script> | |
export default { | |
props: ['value'], |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[alias] | |
cm = commit | |
co = checkout | |
p = push | |
pp = pull | |
tags = tag -l | |
b = branch | |
bb = branch -a | |
bd = branch -D | |
pod = push origin --delete |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{{ $cfg := .Cfg }} | |
{{ $IsIPV6Enabled := .IsIPV6Enabled }} | |
{{ $healthzURI := .HealthzURI }} | |
{{ $backends := .Backends }} | |
{{ $proxyHeaders := .ProxySetHeaders }} | |
daemon off; | |
worker_processes {{ $cfg.WorkerProcesses }}; | |
pid /run/nginx.pid; | |
{{ if ne .MaxOpenFiles 0 }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
openssl genrsa -out $1.key 2048 | |
openssl rsa -in $1.key -out $1.key | |
chmod 400 $1.key | |
openssl req -new -key $1.key -out $1.csr -subj "/CN=$1" | |
openssl x509 -req -in $1.csr -days 365 -CA server.crt -CAkey server.key -out $1.crt -CAcreateserial | |
rm $1.csr |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<template> | |
<div id="app"> | |
<input ref="q"> | |
<button v-stream:click="q$">Search</button> | |
<div> | |
<h1>{{ topic }} ({{ page }} / {{ totalPage }})</h1> | |
<select v-stream:change="perPage$"> | |
<option :value="10">10</option> | |
<option :value="15">15</option> | |
<option :value="20">20</option> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func removeDuplicateLoop(arr []int) []int { | |
p := append([]int{}, arr...) | |
for i := range p { | |
for j := i + 1; j < len(p); j++ { | |
if p[i] == p[j] { | |
p = append(p[:j], p[j+1:]...) | |
j-- | |
} | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func removeDuplicateMap(arr []int) []int { | |
p := make(map[int]struct{}) | |
for _, v := range arr { | |
p[v] = struct{}{} | |
} | |
r := make([]int, 0, len(p)) | |
for v := range p { | |
r = append(r, v) | |
} | |
return r |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func removeDuplicateLoop2(arr []int) []int { | |
r := make([]int, 0) | |
for i := range arr { | |
for j := range r { | |
if arr[i] == r[j] { | |
goto duplicated | |
} | |
} | |
r = append(r, arr[i]) |
OlderNewer