Skip to content

Instantly share code, notes, and snippets.

@gakuzzzz
gakuzzzz / action-function.md
Last active April 6, 2023 01:47
ActionFunction の紹介 - Play framework Advent Calendar 2014 7日目

ActionFunction の紹介

この記事は Play framework Advent Calendar 2014 の7日目です。

昨日は @dorako321 さんの Play framework Advent Calendar 2014 6日目 位置情報を使ってみよう でした。

明日は @nazoking さんの play2.3 の sbt-web を使わず node で代替システムを作るための資料 です。

さて、そんなこんなで公式ドキュメントではまだ語られていない ActionFunction とそのサブトレイトについて紹介したいと思います。 (公式ドキュメントにも記載ありました https://www.playframework.com/documentation/2.3.x/ScalaActionsComposition#Different-request-types )

@takezoe
takezoe / DailyScala_FunctionAdvance.md
Last active December 3, 2019 04:18
Scalaの関数を活用するためのあれこれ

Scalaの関数を活用する

Functionオブジェクト

Scalaでは関数をファーストクラスオブジェクトとして扱うことができる。以下のような感じで関数やメソッドを変数に代入するとFunctionオブジェクトに変換される。実際は引数の数に応じてFunction0Function22というトレイトが用意されている。なので引数の数が22個以上の関数を変数に代入しようとするとエラーになる。

def hello(name: String) = s"Hello ${name}!"

// 関数を変数に代入
@scova0731
scova0731 / scala-learning-resource.md
Created February 27, 2015 04:02
Scala 学習リソース (2015/2版)

定番、および比較的最近の学習リソースを集めてみました (2015/2)。

リファレンス

記事等

@scova0731
scova0731 / scala-image-processing.md
Last active December 31, 2015 17:07
Scala/Java 画像変換ライブラリ調査 (2015/3)
@manjuraj
manjuraj / scalaz-disjunction.scala
Last active November 12, 2018 16:15
scalaz disjunction
//
// Disjunction - aka Scalaz Either
// \/[A, B] is an alternative to Either[A, B]
// -\/ is Left (usually represents failure by convention)
// \/- is Right (usually represents success by convention)
// Left or Right - which side of the Disjunction does the "-" appear?
//
// Prefer infix notation to express Disjunction Type v: String \/ Double
//
// References
@manjuraj
manjuraj / scalaz-validation.scala
Last active June 25, 2018 21:01
scalaz validation
//
// Validation[E, A] represents either:
// - Success[A]
// - Failure[E]
//
// Isomporphic to scala.Either[E, A] and scalaz.\/[E, A]
//
// Unlike \/[E, A], Validation is not a Monad, but an Applicative
// Functor. So if you want to use it as a Monad you can convert back
// and forth using the `validation` and `disjunction` method
@hashrock
hashrock / diag.md
Last active April 30, 2026 06:23
作図系ツール・ライブラリまとめ

シーケンス図とかフローチャートをしごとで描画することになった場合、 テキストから生成できたら楽なので、それ系のツールまとめ

GraphViz

http://www.graphviz.org/

  • C製
  • Doxygen, Moinmoinなどと連携可能
  • ブロック図、クラス図、ネットワーク図など

セキュリティのメモ

レスポンスメッセージ

  • ステータスライン

例: HTTP/1.1 200 OK

  • ヘッダ
    • Date
    • Server (Apache/2.2.14 Ubuntuとか)
    • Content-Length (ボディのバイト数)
  • Content-Type (MIMEタイプ text/plain, image/gifなど)
@aaronlevin
aaronlevin / events.hs
Last active December 3, 2023 13:03
LambdaWorld 2016 & Typelevel Summit 2017 (Copenhagen): Type-Level DSLs // Typeclass induction
-- Our goal is to create a type describing a list of events. This is our
-- type-level DSL.
-- We will then use typeclass resolution to "interpret" this type-level DSL
-- into two things:
-- 1. A comma-separated list of events
-- 2. A method that, when given an event name and a payload, will try to parse
-- that event type with the payload. A form of dynamic dispatching
--
-- To model a list of types we will use tuples. You can imagine the list of
-- types "Int, String, Char" to look like:
@takezoe
takezoe / play2.6_highlight.md
Last active July 5, 2017 01:35
Play 2.6のハイライト

原文はこちら: https://www.playframework.com/documentation/2.6.x/Highlights26

グローバルステートが非推奨に

アプリケーションではplay.api.Play.current / play.Play.application()でグローバルアプリケーションにアクセスできるけど非推奨。以下のようにして禁止することもできる。

play.allowGlobalApplication=false