Skip to content

Instantly share code, notes, and snippets.

View nakabonne's full-sized avatar
👋

Ryo Nakao nakabonne

👋
View GitHub Profile
package main
import (
"bytes"
"encoding/binary"
"testing"
)
type Data struct {
ID uint32

Keybase proof

I hereby claim:

  • I am nakabonne on github.
  • I am nakabonne (https://keybase.io/nakabonne) on keybase.
  • I have a public key whose fingerprint is CCF2 8332 E6CB 777E C33A 54EF 4192 AC2E EF55 8144

To claim this, I am signing this object:

@nakabonne
nakabonne / aes256-gcm.go
Created December 19, 2020 06:19
Example of AES-256 GCM encryption with a key derived from password
package main
import (
"crypto/aes"
"crypto/cipher"
"crypto/rand"
"crypto/sha256"
"fmt"
"log"
@nakabonne
nakabonne / ecr_client.go
Created December 9, 2020 09:47
An ECR client to determine the latest tag of the given repository
package main
import (
"context"
"fmt"
"log"
"path"
"sort"
"github.com/aws/aws-sdk-go/aws"
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)
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
@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
directory layer
external frameworks & drivers
adapter interface adapters
usecase app business rules
domain enterprise business rules
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,
"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'))