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
{{ $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
<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]) |
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
package main | |
import ( | |
"context" | |
"log" | |
"net/http" | |
"os" | |
"os/signal" | |
"sync" | |
"syscall" |
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
package main | |
import ( | |
"log" | |
"net/http" | |
"time" | |
"github.com/acoshift/hime" | |
"github.com/acoshift/probehandler" | |
) |
OlderNewer