This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/sh | |
yum install -y wget java-1.7.0-openjdk | |
wget -O /etc/yum.repos.d/jenkins.repo http://pkg.jenkins-ci.org/redhat/jenkins.repo | |
rpm --import http://pkg.jenkins-ci.org/redhat/jenkins-ci.org.key | |
yum install -y jenkins | |
service jenkins restart |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM centos | |
MAINTAINER Arata Tanaka | |
# RUN:buildするときに実行される | |
RUN echo "now building ..." | |
# CMD: runするときに実行される | |
CMD ["echo", "now running..."] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package "gcc" | |
package "mercurial" | |
package "ncurses-devel" | |
package "lua" | |
package "lua-devel" | |
execute "hg clone https://vim.googlecode.com/hg/ vim" do | |
cwd "/usr/local/src/" | |
not_if "test -d /usr/local/src/vim/src" | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"math" | |
) | |
func Sqrt(x float64) float64 { | |
z := float64(1) | |
const count = 10 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
create table fuga(id int, name varchar(255)); | |
create table piyo(id int, name varchar(255)); | |
insert into fuga values(1, "fugafuga"); | |
insert into piyo values(1, "fugafuga"); | |
select * from fuga f inner join piyo p on f.id = p.id; | |
/* | |
+------+----------+------+----------+ | |
| id | name | id | name | | |
+------+----------+------+----------+ | |
| 1 | fugafuga | 1 | fugafuga | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def fibFrom(a:Long, b:Long): Stream[Long] = a #:: fibFrom(b, a+b) | |
println(fibFrom(0l, 1l).take(50).toList) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package my.twitter | |
import twitter4j._ | |
import conf._ | |
/* | |
* ref http://tototoshi.hatenablog.com/entry/20111104/1320377494 | |
* libraryDependencies ++= Seq( | |
* "org.twitter4j" % "twitter4j-core" % "2.2.5", | |
* "org.twitter4j" % "twitter4j-stream" % "2.2.5" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>HTML5 でドラッグ&ドロップ</title> | |
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script> | |
<script language="javascript"> | |
$(function() { | |
var droppable = $("#droppable"); | |
// File API が使用できない場合は諦めます. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
val hoge:List[String] = List[String]("hoge", "fuga", "piyo") | |
println(hoge) | |
val fuga = for { | |
id <- hoge | |
} yield id + "__" | |
println(fuga) | |
/* | |
* List(hoge, fuga, piyo) | |
* List(hoge__, fuga__, piyo__) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
object Main extends App { | |
// List | |
val sample1: List[Int] = List(1, 2, 3, 4, 5) | |
// map | |
// output -> List(2, 4, 6, 8, 10) | |
println(sample1.map(i => i * 2)) |