Skip to content

Instantly share code, notes, and snippets.

View bigwheel's full-sized avatar

k.bigwheel (kazufumi nishida) bigwheel

View GitHub Profile
# play-jsonからhoconフォーマットへだいたい変換するスクリプト
# Seqだけはカッコが同一行へ存在しないと変換を失敗する
sed -i -e 's/Json.obj(/{/g' $1
sed -i -e 's/ -> /: /g' $1
sed -i -e 's/,$//g' $1
sed -i -e 's/Seq(\(.*\))/[\1]/g' $1
sed -i -e 's/L$//g' $1
sed -i -e 's/)/}/g' $1
sed -i -e 's/^\(\s*\)"\([^"]*\)"/\1\2/g' $1
@bigwheel
bigwheel / build.sbt
Created October 21, 2014 08:29
sbtでカスタムタスクを定義する方法
val scoobiRun = taskKey[Int]("A sample int task.")
scoobiRun := {
(compile in Compile).value
println(1)
1
}
@bigwheel
bigwheel / scalaほしいものリスト.md
Created October 29, 2014 11:00
scalaほしいものリスト
  • specs2よりベターなテストフレームワーク
    • より具体的に言うとrspecのようにnestしても同じように書ける一貫性が欲しい(テストの構造化をより自由に行うため)
  • rubyのwebmockのようなhttp mock server
  • テストフレームワークとシームレスに結合できるタイプのものがほしい。WireMockはrequestのmatchingの自由度が低すぎる

概要

校内カースト最底辺のギークが協力者を得て知恵を絞り、ジョックを倒してクインビーを獲得するサクセスストーリー。 ペットの青いたぬきがマスコットとして人気を博した。

著者

藤子F不二雄

登場人物

package utils.specs2
import org.specs2.main.SmartDiffs
import play.api.libs.json._
import scala.util.Success
import scala.util.Try
object JsonProcessableDiffs extends SmartDiffs {
private[this] def toJsObectOption(map: Map[String, JsValue]) = if (map.isEmpty)
import com.sksamuel.elastic4s.ElasticClient
import com.sksamuel.elastic4s.ElasticDsl._
import com.sksamuel.elastic4s.ElasticsearchClientUri
import org.elasticsearch.common.settings.ImmutableSettings
import org.elasticsearch.node.NodeBuilder._
import scala.collection.JavaConverters._
object Main {
private def transportClient = {
val settings = ImmutableSettings.settingsBuilder.
// ==UserScript==
// @name Github milestone enhanced issue list
// @namespace https://github.com/bigwheel
// @version 1.0
// @description this is description
// @author bigwheel
// @match http://github.o-in.dwango.co.jp/*
// @grant GM_xmlhttpRequest
// @require http://crypto-js.googlecode.com/svn/tags/3.1.2/build/rollups/md5.js
// ==/UserScript==
[error] RemoteTransportException: : [node03][inet[/192.168.1.3:9300]][indices:data/read/search] (TransportSearchTypeAction.java:233)
[error] org.elasticsearch.action.search.type.TransportSearchTypeAction$BaseAsyncAction.onFirstPhaseResult(TransportSearchTypeAction.java:233)
[error] org.elasticsearch.action.search.type.TransportSearchTypeAction$BaseAsyncAction$1.onFailure(TransportSearchTypeAction.java:179)
[error] org.elasticsearch.search.action.SearchServiceTransportAction$6.handleException(SearchServiceTransportAction.java:249)
[error] org.elasticsearch.transport.netty.MessageChannelHandler.handleException(MessageChannelHandler.java:185)
[error] org.elasticsearch.transport.netty.MessageChannelHandler.handlerResponseError(MessageChannelHandler.java:175)
[error] org.elasticsearch.transport.netty.MessageChannelHandler.messageReceived(MessageChannelHandler.java:125)
[error] org.elasticsearch.common.netty.channel.SimpleChannelUpstreamHandler.handleUpstream(SimpleChannelUpstreamHandler.java:70)
[error] org.el
@bigwheel
bigwheel / lunch.rb
Created August 2, 2012 03:46
ランダムに2チームへ分けるスクリプト 超人パワー編
#!/usr/bin/env ruby
srand(Time.local(2012, 8, 2).to_i)
class Member
attr_reader :name, :power
def initialize(name)
@name = name
@power = rand
end
@bigwheel
bigwheel / gist:3300587
Created August 9, 2012 03:13
ランダムに2チームへ分けるスクリプト ジャンケン編
#!/usr/bin/env ruby
class Member
attr_reader :name
def initialize(name)
@name = name
end
def win?(opponent)
result_table = { gu: { gu: :even, choki: :win, pa: :lose },