Skip to content

Instantly share code, notes, and snippets.

View j5ik2o's full-sized avatar

Junichi Kato j5ik2o

View GitHub Profile
@mpppk
mpppk / clean_architecture.md
Last active April 24, 2024 03:05
クリーンアーキテクチャ完全に理解した

2020/5/31追記: 自分用のメモに書いていたつもりだったのですが、たくさんのスターを頂けてとても嬉しいです。
と同時に、書きかけで中途半端な状態のドキュメントをご覧いただくことになっており、大変心苦しく思っています。

このドキュメントを完成させるために、今後以下のような更新を予定しています。

  • TODO部分を埋める
  • 書籍を基にした理論・原則パートと、実装例パートを分割
    • 現在は4層のレイヤそれぞれごとに原則の確認→実装時の課題リスト→実装例という構成ですが、同じリポジトリへの言及箇所がバラバラになってしまう問題がありました。更新後は、実装時の課題リストを全て洗い出した後にまとめて実装を確認する構成とする予定です。

2021/1/22追記:

@mpneuried
mpneuried / Makefile
Last active April 19, 2024 21:06
Simple Makefile to build, run, tag and publish a docker containier to AWS-ECR
# import config.
# You can change the default config with `make cnf="config_special.env" build`
cnf ?= config.env
include $(cnf)
export $(shell sed 's/=.*//' $(cnf))
# import deploy config
# You can change the default deploy config with `make cnf="deploy_special.env" release`
dpl ?= deploy.env
include $(dpl)
@hayajo
hayajo / changelog_en.md
Last active April 16, 2024 12:57
ChangeLog を支える英語

ChangeLog を支える英語

ChangeLog を書く際によく使われる英語をまとめました。

ほとんど引用です。

基本形

@14427
14427 / hkt.rs
Last active February 7, 2024 10:18
Higher-kinded type trait
use std::rc::Rc;
trait HKT<U> {
type C; // Current type
type T; // Type with C swapped with U
}
macro_rules! derive_hkt {
($t:ident) => {
impl<T, U> HKT<U> for $t<T> {
@snoyberg
snoyberg / abonimable-snoyman.rs
Created December 2, 2020 15:05
Playing with GATs, transformers, and more
#![feature(generic_associated_types)]
#[allow(dead_code)]
trait Functor {
type Unwrapped;
type Wrapped<B>: Functor;
fn map<F, B>(self, f: F) -> Self::Wrapped<B>
where
F: FnMut(Self::Unwrapped) -> B;
@poutyface
poutyface / git
Created December 29, 2010 17:37
gitの使い方
githubへ登録
===========
git remote add origin git@github.com:<username>/<application_name>.git
git push origin master
初期設定
=======
git config --global user.name "Foo Bar"
git config --global user.email "foo@bar.com"
@brunoborges
brunoborges / DSLWicket.scala
Created July 27, 2011 15:22
Scala DSL for Wicket
package code.webapp
import scala.collection.JavaConversions.seqAsJavaList
import org.apache.wicket.behavior.AttributeAppender
import org.apache.wicket.datetime.markup.html.form.DateTextField
import org.apache.wicket.extensions.validation.validator.RfcCompliantEmailAddressValidator
import org.apache.wicket.markup.html.basic.{ MultiLineLabel, Label }
import org.apache.wicket.markup.html.form.{ TextField, TextArea, SubmitLink, RadioGroup, Radio, PasswordTextField, FormComponent, Form, DropDownChoice, CheckGroup, Button }
import org.apache.wicket.markup.html.link.{ Link, BookmarkablePageLink }
import org.apache.wicket.markup.html.link.ExternalLink
@stonegao
stonegao / rest.scala
Created October 9, 2011 16:05 — forked from robi42/rest.scala
Basic RESTful service with Finagle
class Respond extends Service[Request, Response] with Logger {
def apply(request: Request) = {
try {
request.method -> Path(request.path) match {
case GET -> Root / "todos" => Future.value {
val data = Todos.allAsJson
debug("data: %s" format data)
Responses.json(data, acceptsGzip(request))
}
case GET -> Root / "todos" / id => Future.value {
@okapies
okapies / mastodon-ostatus.md
Last active September 5, 2021 11:39
Mastodon OStatus API の叩き方

Mastodon が他のインスタンスと情報交換をする OStatus API の使い方。使ってるだけのユーザは知る必要がない裏側の話。

host-meta

Mastodon インスタンスに対して、RFC6415 が規定する /.well-known/host-meta というパスを要求すると以下の XML が返ってくる.

<?xml version="1.0"?>
<XRD xmlns="http://docs.oasis-open.org/ns/xri/xrd-1.0">
  <Link rel="lrdd" type="application/xrd+xml" template="https://[MASTODON_HOST]/.well-known/webfinger?resource={uri}"/>
</XRD>
@segfo
segfo / recursive_trampoline.rs
Last active August 14, 2021 23:53
Rustで末尾再帰のトランポリン化
enum RetVal {
Num(u128),
Recursive(Box<dyn Fn() -> RetVal>),
}
fn trampoline(r: RetVal) -> u128 {
let mut r = r;
loop {
match &r {
RetVal::Recursive(func) => {