Skip to content

Instantly share code, notes, and snippets.

View seratch's full-sized avatar

Kazuhiro Sera seratch

View GitHub Profile
import java.util.UUID
import org.joda.time.DateTime
import java.sql.SQLException
import scala.Option
import scalikejdbc.SQLInterpolation.SQLSyntaxSupport
import util.control.Exception._
import java.sql.Connection
import scalikejdbc._
import scalikejdbc.SQLInterpolation._
@seratch
seratch / find_scct.sh
Created July 13, 2013 00:41
Finding scct dependency in Compile
BASE_URL=https://oss.sonatype.org/content/repositories/releases/com/github/seratch
VERSION=1.6.5
for SCALA_VERSION in 2.9.1 2.9.2 2.9.3 2.10
do
for NAME in scalikejdbc scalikejdbc-interpolation-core scalikejdbc-interpolation-macro scalikejdbc-interpolation scalikejdbc-config scalikejdbc-test scalikejdbc-mapper-generator-core scalikejdbc-mapper-generator scalikejdbc-play-plugin scalikejdbc-play-fixture-plugin
do
URL=${BASE_URL}/${NAME}_${SCALA_VERSION}/${VERSION}/${NAME}_${SCALA_VERSION}-${VERSION}.pom
echo ${URL}
curl --silent ${URL} | grep -3 scct
done
@seratch
seratch / main.md
Last active December 20, 2015 15:29
第 2 回 虎ノ門 Scala 飲み会について

経緯

以前、虎ノ門界隈でご近所なシャノンさん、アリエルさん、エムスリーの Scala 好きなエンジニア + @yusuke さんで交流会をしました。7/30 の Heroku Meetup で久しぶりに会った @benzookapi さんと @seratch の間でまたやりましょうということに。今回は場所は新橋あたり、上記の 3 社の人以外の方もお誘いしてやりましょう、ということでお声がけしている感じです。

調整さん

日程は 8/30(金)19:00 〜@新橋のどこかで確定とします。@kiris さんごめんなさい・・

http://chouseisan.com/schedule/List?h=2172f39df2e59ffa1619c678925e4c25

@seratch
seratch / repl.scala
Created August 9, 2013 08:27
mocked DBSession
scala> import org.mockito.Mockito._
import org.mockito.Mockito._
scala> implicit val session: DBSession = mock(classOf[DBSession])
session: scalikejdbc.DBSession = Mock for DBSession, hashCode: 339695449
scala> sql"select * from companies".map(_.toMap).list.apply()
res0: List[Map[String,Any]] = null
scala> :q
import java.security.MessageDigest
import scala.xml.{Elem, XML}
case class Slideshow(id: Long, title: String, username: String)
object Main {
def main(args: Array[String]) {
val apiKey = System.getenv("SLIDESHARE_API_KEY")
val sharedSecret = System.getenv("SLIDESHARE_SHARED_SECRET")
@seratch
seratch / SampleSpec.scala
Last active December 22, 2015 12:39
Sending ScalikeJDBC query logs to Fluentd
package example
import scalikejdbc._, SQLInterpolation._, config._, async._
import org.fluentd.logger.scala._
import org.scalatest._, matchers._
import scala.concurrent._, duration.DurationInt, ExecutionContext.Implicits.global
class SampleSpec extends FlatSpec with ShouldMatchers {
case class Name(id: Long, kanji: String, kana: String)
@seratch
seratch / brew_update_failure_fix.sh
Last active December 25, 2015 01:49
brew upadte failure
cd /usr/local/Library/Formula
mv apple-gcc42.rb apple-gcc42.rb.bk
brew update
@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 がリリースされました)

@seratch
seratch / REPL.scala
Last active December 30, 2015 05:19
Trying FluentLenium
import org.fluentlenium.core._
val driver = new org.openqa.selenium.firefox.FirefoxDriver
object Firefox extends Fluent(driver)
Firefox.goTo("http://www.google.com")
driver.quit
:q
@seratch
seratch / console.log
Created March 12, 2014 12:29
sbt-man failure
> man skinny.SkinnyEnv
[error] java.util.concurrent.ExecutionException: dispatch.StatusCode: Unexpected response status: 500
[error] Use 'last' for the full log.
> last
java.util.concurrent.ExecutionException: dispatch.StatusCode: Unexpected response status: 500
at com.ning.http.client.providers.netty.NettyResponseFuture.abort(NettyResponseFuture.java:329)
at com.ning.http.client.providers.netty.NettyAsyncHttpProvider.abort(NettyAsyncHttpProvider.java:1409)
at com.ning.http.client.providers.netty.NettyAsyncHttpProvider.access$800(NettyAsyncHttpProvider.java:143)
at com.ning.http.client.providers.netty.NettyAsyncHttpProvider$HttpProtocol.handle(NettyAsyncHttpProvider.java:2360)
at com.ning.http.client.providers.netty.NettyAsyncHttpProvider.messageReceived(NettyAsyncHttpProvider.java:1204)