Skip to content

Instantly share code, notes, and snippets.

View shiimaxx's full-sized avatar
🦊

Takatada Yoshima shiimaxx

🦊
View GitHub Profile
@shiimaxx
shiimaxx / image-syncer-poc.go
Created November 25, 2021 06:26
liyunContainerService/image-syncer で docker.io/ubuntu:20.04 のコンテナイメージを ECR に同期する
package main
import (
"github.com/AliyunContainerService/image-syncer/pkg/sync"
"github.com/AliyunContainerService/image-syncer/pkg/tools"
"github.com/sirupsen/logrus"
)
func main() {
logger := logrus.New()
@shiimaxx
shiimaxx / main.go
Created March 27, 2021 11:13
GitLab API v4 POST /projects/:id/uploads
package main
import (
"bytes"
"fmt"
"io"
"log"
"mime/multipart"
"net/http"
"os"
@shiimaxx
shiimaxx / memo.md
Last active December 20, 2019 16:40
Graphite検証環境構築手順
# タイムゾーン設定
$ sudo timedatectl set-timezone Asia/Tokyo

# Graphiteインストール
$ sudo apt update && sudo apt install -y apache2 libapache2-mod-wsgi graphite-web graphite-carbon python-whisper
$ sudo rm -f /etc/apache2/sites-enabled/000-default.conf
$ sudo ln -s /usr/share/graphite-web/apache2-graphite.conf /etc/apache2/sites-enabled/
$ sudo systemctl restart apache2
@shiimaxx
shiimaxx / code-reading.md
Created April 25, 2018 11:52
`jpeg.Encode`のコードリーディング
func Encode(w io.Writer, m image.Image, o *Options) error {

引数wio.Writerインターフェースを実装している型の変数を取る。

	var e encoder
	if ww, ok := w.(writer); ok {
 e.w = ww
@shiimaxx
shiimaxx / code-reading.md
Created April 25, 2018 11:24
`image.Decode()`のコードリーディング
func Decode(r io.Reader) (Image, string, error) {

os.Fileなどのio.Readerインターフェースを実装している型の変数を引数に取る。

	rr := asReader(r)