Skip to content

Instantly share code, notes, and snippets.

View nakabonne's full-sized avatar
👋

Ryo Nakao nakabonne

👋
View GitHub Profile
git clone https://github.com/grpc/grpc.git
@nakabonne
nakabonne / reverse_polishn_notation.rb
Created July 17, 2017 08:51
逆ポーランド記法をrubyで実装
x = gets.chomp.split(' ')
s = []
x.each do |n|
case n
when '+'
one = s.pop
two = s.pop
s.push(one+two)
when '-'
one = s.pop
package main
import (
"flag"
"fmt"
"time"
"github.com/marcusolsson/tui-go"
)
func getSERPsURLs(baseURL *url.URL, depth int) (pages []*url.URL, err error) {
doc, err := getDoc(baseURL)
i := 0
doc.Find("#nav").Each(func(_ int, table *goquery.Selection) {
table.Find("tbody").Each(func(_ int, trs *goquery.Selection) {
trs.Find("tr").Each(func(_ int, tds *goquery.Selection) {
tds.Find("td").Each(func(_ int, srg *goquery.Selection) {
srg.Find("a").Each(func(_ int, s *goquery.Selection) {
if i >= depth-1 {
return
"NeoBundle Scripts-----------------------------
if &compatible
set nocompatible " Be iMproved
endif
" Required:
set runtimepath+=/Users/NakaoRyo/.vim/bundle/neobundle.vim/
" Required:
call neobundle#begin(expand('/Users/NakaoRyo/.vim/bundle'))
let g:go_highlight_functions = 1
let g:go_highlight_methods = 1
let g:go_highlight_structs = 1
let g:go_highlight_extra_types = 1
let g:go_highlight_operators = 1
let g:go_highlight_function_calls = 1
let g:go_highlight_types = 1
let g:go_highlight_fields = 1
let g:neomake_go_errcheck_maker = {
\ 'append_file': 0,
directory layer
external frameworks & drivers
adapter interface adapters
usecase app business rules
domain enterprise business rules
@nakabonne
nakabonne / origin-update.sh
Created November 28, 2018 06:05
This makes origin repository follow upstream it.
#!/bin/bash
set -eu
git checkout master
git fetch upstream
git merge upstream/master
git push
static_resources:
clusters:
- name: zipkin
connect_timeout: 1s
type: static
lb_policy: round_robin
hosts:
- socket_address:
address: 10.5.0.2
port_value: 9411
if int(os.environ['SERVICE_NAME']) == 1 :
for header in TRACE_HEADERS_TO_PROPAGATE:
if header in request.headers:
# Comment out here
# headers[header] = request.headers[header]
ret = requests.get("http://localhost:9000/trace/2", headers=headers)