Skip to content

Instantly share code, notes, and snippets.

module Ruboty
module Handlers
class OginOk < Base
on(
/オッケーですか?/,
name: "ok",
description: "Return オッケーです!"
)
def ok(message)
Gem::Specification.new do |spec|
spec.name = "ogin_ok"
spec.version = "0.0.1"
spec.authors = ["t.oginogin"]
spec.email = ["t.oginogin@example.com"]
spec.summary = "return ok"
spec.files = ["ogin_ok.rb"]
spec.require_path = "."
end
sudo apt-get update
sudo apt-get install gcc
sudo apt-get install make
sudo apt-get install build-essential
sudo apt-get install zlib1g-dev libssl-dev libreadline-dev libyaml-dev libxml2-dev libxslt-dev libffi-dev

sudo apt-get install git
git clone https://github.com/sstephenson/rbenv.git ~/.rbenv
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bash_profile

echo 'eval "$(rbenv init -)"' >> ~/.bash_profile

@t-oginogin
t-oginogin / daemon_spawn.rb
Last active August 29, 2015 14:12
Railsから複数行のLinuxコマンドを非同期で実行させる ref: http://qiita.com/t_oginogin/items/10da086566a092845af4
:
def self.start(daemon, args) #:nodoc:
:
fork do
Process.setsid
exit if fork
open(daemon.pid_file, 'w') { |f| f << Process.pid }
:
end
:
@t-oginogin
t-oginogin / application.css.scss
Last active August 29, 2015 14:06
Rails date_selectをBootstrapを使っていい感じにする ref: http://qiita.com/t_oginogin/items/519fb52e1708e26a8b73
@import "bootstrap-sprockets";
@import "bootstrap";
.bootstrap-date {
display: inline-block;
width: auto;
}
@t-oginogin
t-oginogin / Capfile
Created August 29, 2014 02:28
Cloudn上にCapistrano3を使ってNginx+unicorn+Railsアプリをデプロイしてみた ref: http://qiita.com/t_oginogin/items/7e81582329925bec59a4
# Load DSL and Setup Up Stages
require 'capistrano/setup'
# Includes default deployment tasks
require 'capistrano/deploy'
# Includes tasks from other gems included in your Gemfile
#
# For documentation on these, see for example:
#
ruby2.1.2でいろいろ操作した結果
# ===============
# ローカル変数のスコープ
# スコープ外はエラー
# ===============
x=1
def foo
puts x
end
ruby1.8.7でいろいろ操作した結果
# ===============
# ローカル変数のスコープ
# スコープ外はエラー
# ===============
x=1
def foo
puts x
end
@t-oginogin
t-oginogin / docker
Created August 10, 2014 00:28
CentOS6 on Google Compute EngineにDockerを入れ、Genome解析ツールをセットアップする ref: http://qiita.com/t_oginogin/items/f04e60ea54ef85a47859
export TMPDIR=/data/tmp