Skip to content

Instantly share code, notes, and snippets.

View keokent's full-sized avatar

kenta takeo keokent

  • GMO Pepabo, Inc.
View GitHub Profile
@keokent
keokent / Sekigae.java
Last active December 17, 2015 16:39
javaでつくった席替えスクリプトです。
import java.util.ArrayList;
import java.util.Collections;
public class Sekigae{
public static void main(String[] args){
ArrayList<String> list = new ArrayList<String>();
list.add("okkun");
list.add("kitak");
@keokent
keokent / 4_6_1.rb
Created May 24, 2013 03:57
Rails Tutorial Chapter4 Exercises 1
def string_shuffle(s)
s.split("").shuffle.join
end
p string_shuffle("foobar")
@keokent
keokent / 4_6_2.rb
Created May 24, 2013 03:58
Rails Tutorial Chapter4 Exercises 2
class String
def shuffle
self.split("").shuffle.join
end
end
p "foobar".shuffle
@keokent
keokent / 4_6_3.rb
Created May 24, 2013 03:59
Rails Tutorial Chapter4 Exercises 3
person1 = {:first => "Gendo", :last => "Ikari"}
person2 = {:first => "Yui", :last => "Ikari"}
person3 = {:first => "Shinji", :last => "Ikari"}
params = {:father => person1, :mother => person2, :child => person3}
p params[:father][:first]
@keokent
keokent / Sekigae_tnmt.java
Created May 24, 2013 10:17
教えていただいたSekigae.javaの改良版!
import java.util.ArrayList;
import java.util.Collections;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.time.DateUtils;
public class Sekigae{
public static void main(String[] args){
ArrayList<String> list = new ArrayList<String>();
@keokent
keokent / memo
Created June 19, 2013 01:45
VMでsample_appを動かすための環境構築コマンド履歴 未整理版
MySQLのインストール
$ sudo yum -y install mysql-server
Nginxのインストール
$ ls /etc/yum.repos.d/
$ cat /etc/yum.repos.d/cobbler-config.repo
% rpm -ql nginx
% sudo /usr/sbin/nginx これで起動
@keokent
keokent / 6.19.memo
Last active December 18, 2015 16:39
手元のPCからsshでserverspecを使うためにspec_helperの編集と新しいVMにrubygemsとpuppet、gitを入れた。
serverspecでテストするどん
手元のPCからsshでserverspecをやる
サーバーにログインするときにパスワード認証が必要
spec_helperの変更
------------------------------------------------------------------------------
require 'serverspec'
require 'pathname'
require 'net/ssh'
@keokent
keokent / 6.20.memo
Created June 21, 2013 01:34
Nginx,MySQLの設定、起動のManifestを書いた
puppet manifestを書いていくどん
app002の/home/keoken/sample_app_puppet/sample_app_manifest.ppに
manifestを書いていく
もろもろのインストール
sample_app_manifest.pp
--------------------------------------------
package {
@keokent
keokent / 7.1.memo
Last active December 19, 2015 05:48
Puppetで構築したVMにRailsアプリを入れて、Unicornを起動する。
appuserのホームディレクトリにsample_appをgit clone
[keoken@app002]~% sudo -u appuser sh -c 'cd /home/appuser;git clone https://github.com/keokent/sample_app.git'
その前に
rubyがちゃんと入ってなかった疑惑
ruby -vをたたくとデフォルトで入っているrubyが指定されている
bash -c 'ruby -v'とやるとruby-2.0.0-p195が指定されてた
@keokent
keokent / YAPC::Asia Tokyo 2013 9-20.md
Last active December 23, 2015 12:49
YAPC::Asia Tokyo 2013 9-20

YAPC::Asia Tokyo 2013 9-20

学術分野におけるperl

  • 研究テーマが大規模で先輩から引き継ぐ系が多くそのため、perlのコードが代々引き継がれる  - 学生はperlを書かざるをえない

  • perlは言語処理という印象

  • 正規表現、文字列処理に強い