Skip to content

Instantly share code, notes, and snippets.

View daneko's full-sized avatar

Koichi Akatsuka daneko

View GitHub Profile
@daneko
daneko / 01.md
Created November 4, 2012 10:58
RhodeCodeを実験的に入れてみた

最初に入れたもの

yum -y install yum-priorities
yum -y install wget
yum -y install vim-enhanced.x86_64

wget http://ftp-srv2.kddilabs.jp/Linux/distributions/fedora/epel/6/x86_64/epel-release-6-7.noarch.rpm
rpm -ivh epel-release-6-7.noarch.rpm

wget http://rpms.famillecollet.com/enterprise/remi-release-6.rpm

@daneko
daneko / MapReduceSample.scala
Last active October 11, 2015 04:58
sample * unittest for playframework 2.0.3 + salat(mongodb) * mapReduce casbah
/**
* ほぼjsで書いているのようなものなので、jsで書いて動かしてから移植したほうが楽かも
*/
/**
* type JSFunction = String となっているので、ほんとに文字列
* mapReduceを書く場合の、map部分をjsで書けばOK
*/
val mapF: String => JSFunction = { category =>
"""
@daneko
daneko / memo1.scala
Created September 9, 2012 15:30
Scalaの部分適応とカリー化
// 全部問題ない
def hoge(x:Int, y:Int, f:(Int, Int) => Int) = f(x,y)
// hogeをカリー化
val fuga = hoge _ curried
// hogeを部分適応
val piyo = hoge(3, _:Int, _:(Int, Int) => Int)
def index(id:String) = Action {
getFirstData(id)
}
private def getFirstData(id:String) = {
Cache.get(id) match {
case Some(id2) => getSecondData(id2)
case None => NotFound
}
}
private def getSecondData(id2:String) = {
@daneko
daneko / SampleScalaAcceptanceSpecs2.scala
Created April 1, 2012 23:00
Scala ide for eclispe + specs2
// このへんEclipseのTemplateみたいな感じにするのがいいかもしれない
import org.specs2._
import org.specs2.runner.JUnitRunner
import org.junit.runner.RunWith
@RunWith(classOf[JUnitRunner])
class HelloSpecs2 extends Specification {
def is =
@daneko
daneko / jenkins.conf
Created March 21, 2012 01:51
/etc/nginx/conf.d/* メモ
# /etc/nginx/conf.d/jenkins.conf サンプル
server {
listen 80;
server_name jenkins.3a3k.info;
access_log /var/log/nginx/jenkins.access.log;
# document root
location / {
proxy_pass http://localhost:8080;
@daneko
daneko / memo.txt
Created March 19, 2012 16:23
Ubuntu Server 10.04 LTS amd64 構築 Cloudcore
まずは以下のとおり作業
http://www.cloudcore.jp/vps/faq/os/ubuntu/
$ mkdir .ssh
$ chmod 700 .ssh
# id_rsa.pubをscpで .sshにup
$ mv .ssh/id_rsa.pub .ssh/authorized_keys
$ chmod 600 .ssh/authorized_keys
@daneko
daneko / memo.txt
Created March 12, 2012 14:44
IntellijでScala
基本ここ
http://confluence.jetbrains.net/display/SCA/Getting+Started+with+IntelliJ+IDEA+Scala+Plugin
homebrewでscalaを入れている場合は
/usr/local/Cellar/scala/2.9.1/libexec/
がScalaのHomeになるはず(バージョンは適当で)
@daneko
daneko / memo.txt
Created March 1, 2012 22:19
CloudCore CentOS5.7 Android開発環境構築(CUI)メモ
http://developer.android.com/sdk/index.html
http://d.hatena.ne.jp/isher/20100928/1285616799
http://d.hatena.ne.jp/unagi_brandnew/20110908/1315420036
# wget sdkのパス
# とりあえず /opt以下に展開
# パスを通す
# android update sdk -u
# -u は guiなしで動作させるオプション
# android -h update sdk の出力は以下
@daneko
daneko / jenkins.conf
Created February 29, 2012 06:30
cloudcore CentOS5.7にjenkins構築
# /etc/nginx/conf.d/jenkins.conf サンプル
server {
listen 80;
server_name jenkins.3a3k.info;
# document root
location / {
proxy_pass http://localhost:8080;
}
}