Skip to content

Instantly share code, notes, and snippets.

@wshino
wshino / Task.scala
Created November 2, 2012 12:15
Scalaquery select firstOption
package models
import play.api.db._
import play.api.Play.current
import org.scalaquery.ql._
import extended.{ExtendedTable => Table}
import org.scalaquery.ql.TypeMapper._
import org.scalaquery.session._
import org.scalaquery.ql.extended.MySQLDriver.Implicit._

依存関係の解決に apache ivy を使う

恐怖、ビルドの仕組みがないプロジェクト

とあるJavaでできたバッチ処理プロジェクトがあったのだが今までビルドの仕組みがなかった。 開発者が各々開発環境のeclipseでビルドをして生成されたクラスファイルを本番サーバにscpしていた。 ちょっとこれは恐ろしいことなので、 レポジトリがCVSからGitに移行したタイミングで仕組みを変更することにした。

基本どの処理もcronで時間を指定してその中からJavaを実行するというものだった。

def create(createdAt: DateTime = DateTime.now)(
implicit session: AsyncDBSession = AsyncDB.sharedSession, cxt: EC = ECGlobal): Future[Log] = {
for {
id <- withSQL {
insert.into(Log).namedValues(column.createdAt -> createdAt)
}.updateAndReturnGeneratedKey.future()
} yield Log(id = id, createdAt = createdAt)
}
@wshino
wshino / build.rb
Created February 6, 2014 10:26
jenkins用のrecipeを書いてみたけど再帰で権限が変更されないのなんで
env = node[:base][:env]
cookbook_file "/etc/sysconfig/jenkins" do
source "build/etc/sysconfig/jenkins"
owner "root"
group "root"
mode "0600"
end
@wshino
wshino / gist:9658050
Created March 20, 2014 05:56
ごめんこれだれのだっけ
➜ ~ cat .tmux.conf
set-option -g prefix C-t
bind t send-prefix
bind r source-file ~/.tmux.conf \; display-message "Reload Config!!"
# ----------------- #
# ウィンドウの振る舞い #
# ----------------- #
## ウィンドウ番号1から開始する
@wshino
wshino / gist:9700375
Created March 22, 2014 02:46
securesocialのsampleでエラー play2.1.5
[info] application - [securesocial] loaded templates plugin: securesocial.controllers.DefaultTemplatesPlugin
[info] play - Starting application default Akka system.
[info] application - [securesocial] loaded user service: class services.MyUserService
[info] application - [securesocial] loaded identity provider: facebook
[info] play - Application started (Dev)
[debug] application - [securesocial] calling deleteExpiredTokens()
[debug] application - [securesocial] bootstrap path = securesocial/bootstrap/css/bootstrap.min.css
[debug] application - [securesocial] assets controller = controllers.ReverseAssets
[debug] application - [securesocial] favicon path = securesocial/images/favicon.png
[debug] application - [securesocial] Jquery path = securesocial/javascripts/jquery-1.7.1.min.js
@wshino
wshino / sample.md
Last active August 29, 2015 14:04
テストのときにfixtureを使うと便利かもしれない
/**
* Created by JP16163 on 2014/08/05.
*/
class User(id:Int, name: String){
def getName = name
}
object Main extends App {
pattern1
autoconf
boot2docker
brew-cask
cabal-install
cloog
docker
faac
ffmpeg
fish
freetype
yum groupinstall 'Development Tools' -y
yum install openssl-devel -y
git clone https://github.com/wg/wrk.git
cd wrk
make
cp wrk /usr/local/bin/