Skip to content

Instantly share code, notes, and snippets.

View Syuparn's full-sized avatar

Syuparn Syuparn

View GitHub Profile
@Syuparn
Syuparn / README.md
Last active May 11, 2024 00:23
OpenFisca Editor プロンプト作成スクリプト

usage

  • homeディレクトリ直下にOpenFisca-Japanをクローン
$ cd ~
$ git clone https://github.com/project-inclusive/OpenFisca-Japan.git
  • 以下のコードを実行しプロンプト作成
@Syuparn
Syuparn / server.pangaea
Created December 10, 2023 01:20
Pangaea API server sample (with in-memory DB)
invite!("http")
idGen := <{|i| yield "user_#{i}"; recur(i+1)}>.new(1)
db := <{|users|
set := {|updated| recur(updated)}
yield [users, set]
}>.new({})
S.serve(
@Syuparn
Syuparn / README.md
Created April 14, 2023 23:09
Tavern: use extra_kwargs in request external function

about

This is a snippet for Tavern external functions.

how to run

  • Requirements
    • Pyenv
    • Poetry
@Syuparn
Syuparn / sample-3.0.yaml
Last active November 10, 2022 22:40
swagger sample
openapi: "3.0.0"
info:
title: "report"
version: 2.0.0
paths:
/report:
delete:
summary: deletes the report.
responses:
'204':
@Syuparn
Syuparn / snippet.md
Last active October 1, 2022 10:57
型変換と型アサーションをまじめに復習する

型アサーション x.(T)

https://go.dev/ref/spec#Type_assertions

  • xがインターフェース、Tがインターフェースでない場合:
    • xの動的型(実行時に代入されている値の実際の型)がTに等しくなければpanic
  • xがインターフェース、Tがインターフェースの場合:
    • xの動的型がTを実装していなければpanic
  • (xがインターフェースでない場合はコンパイルエラー)
@Syuparn
Syuparn / Dockerfile
Created January 2, 2022 08:01
Cro sample REST API server
FROM croservices/cro-http:0.8.5
RUN mkdir /app
COPY . /app
WORKDIR /app
RUN raku -c -Ilib main.p6
CMD raku -Ilib main.p6
@Syuparn
Syuparn / example.go
Created November 3, 2021 12:18
analyze interface methods
package main
// parsed by main.go
type Example interface {
Foo(int, ...interface{}) (int, error)
Hello(name string) (string, error)
}
@Syuparn
Syuparn / Dockerfile
Last active June 9, 2022 23:52
govmomi development environment
FROM golang:1.18
RUN apt-get update -y && \
apt-get install -y bats jq
WORKDIR /go/src/github.com/vmware/govmomi
@Syuparn
Syuparn / reveal_vcsim_uuid.md
Created July 10, 2021 13:23
Reveal the VCSIM UUIDs!

Reveal the VCSIM UUIDs!

About

This note briefly shows how vcsim generates object's UUID.

⚠️ This note is based on vcsim (govmomi) 0.26.0. The latest version might work differently.

Algorithm

@Syuparn
Syuparn / Dockerfile.dapr-contib.dev
Created March 14, 2021 12:01
dapr-contrib dev environment
# https://github.com/dapr/components-contrib/blob/master/docs/developing-component.md
FROM golang:1.16-buster
RUN cd $GOPATH/src
# Clone dapr
RUN mkdir -p github.com/dapr/dapr && \
git clone https://github.com/dapr/dapr.git github.com/dapr/dapr