Skip to content

Instantly share code, notes, and snippets.

View todokr's full-sized avatar
😻
Focusing

Shunsuke Tadokoro todokr

😻
Focusing
View GitHub Profile
@matope
matope / Dynamo: Amazonの高可用性Key-value Store.markdown
Last active November 18, 2022 17:54
Dynamo: Amazonの高可用性Key-value Store[和訳]
@labocho
labocho / handlebars_helpers.coffee
Last active July 10, 2021 13:37
Handlebars で使うヘルパー関数集
##############################
# Formatting
##############################
# Date を "2013年8月31日 (土)" の形式に
Handlebars.registerHelper "d", (date) ->
return "" unless date
weekdays = ["日", "月", "火", "水", "木", "金", "土"]
"#{date.getFullYear()}年#{date.getMonth() + 1}月#{date.getDate()}日 (#{weekdays[date.getDay()]})"
@xuwei-k
xuwei-k / build.sbt
Last active June 24, 2021 01:09
show message when sbt build files changed
val buildFiles = SettingKey[Map[File, Seq[Byte]]]("build-files")
buildFiles := getBuildFiles((baseDirectory in ThisBuild).value)
def getBuildFiles(base: File) =
((base * "*.sbt") +++ ((base / "project") ** ("*.scala" | "*.sbt"))).get.map{
f => f -> collection.mutable.WrappedArray.make[Byte](Hash(f))
}.toMap
def changed(base: File, files: Map[File, Seq[Byte]]): Boolean =
@Shinpeim
Shinpeim / 00.md
Last active January 16, 2020 13:08
Scala 入学式の資料

Better Java としての Scala

Hello World

  • src/main/scala/Main.scala
object Main {
  def main(args: Array[String]): Unit = {
    println("hello scala!")
@seratch
seratch / getting_started_ja.md
Last active June 5, 2018 02:56
Skinny Framework 1.0 Introduction in Japanese

NOTICE: This is just a draft of Skinny framework introduction (written in Japanese for now). English version will be published soon.

Skinny Framework とは

Logo

https://github.com/seratch/skinny-framework

Skinny Framework は Scala のフルスタックな Web アプリケーション開発フレームワークです。2014/03 を目処に最初の安定バージョン 1.0.0 をリリースするべく精力的に開発しています。(追記: 2014/03/28 に 1.0.0 がリリースされました)

@seraphy
seraphy / ExpressionTest.java
Created December 3, 2013 03:43
Expressを使ってリフレクションを直接使うよりも簡単にメソッド名でオブジェクト(Java Beans)にアクセスする方法の例.
package jp.seraphyware.javalangtest;
import java.beans.Expression;
/**
* リフレクションを直接使うよりも簡単にメソッド名で
* オブジェクトにアクセスする方法の例.<br>
*/
public class ExpressionTest {
@taea
taea / rm_pid.md
Last active January 12, 2023 14:22
postgres をちゃんと終了しないと.pidファイルが残っちゃって、Rails が起動しないもんだい

Rails 起動しようとするとこんなエラーでる

PG::ConnectionBad at /
could not connect to server: Connection refused
Is the server running on host "localhost" (::1) and accepting
TCP/IP connections on port 5432?
could not connect to server: Connection refused
Is the server running on host "localhost" (127.0.0.1) and accepting
TCP/IP connections on port 5432?
@gakuzzzz
gakuzzzz / 1_.md
Last active August 2, 2023 01:59
Scala の省略ルール早覚え

Scala の省略ルール早覚え

このルールさえ押さえておけば、読んでいるコードが省略記法を使っていてもほぼ読めるようになります。

メソッド定義

def concatAsString(a: Int, b: Int): String = {
  val a_ = a.toString();
  val b_ = b.toString();
@john2x
john2x / 00_destructuring.md
Last active June 6, 2024 13:40
Clojure Destructuring Tutorial and Cheat Sheet

Clojure Destructuring Tutorial and Cheat Sheet

(Related blog post)

Simply put, destructuring in Clojure is a way extract values from a datastructure and bind them to symbols, without having to explicitly traverse the datstructure. It allows for elegant and concise Clojure code.

Vectors and Sequences

@nobuoka
nobuoka / GoogleHttpJavaClientExample.java
Created November 8, 2014 11:20
google-http-java-client を使用するサンプルコード
import java.io.IOException;
import com.google.api.client.http.GenericUrl;
import com.google.api.client.http.HttpRequest;
import com.google.api.client.http.HttpRequestFactory;
import com.google.api.client.http.HttpResponse;
import com.google.api.client.http.HttpTransport;
import com.google.api.client.http.javanet.NetHttpTransport;
public class GoogleHttpJavaClientExample {