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
# -*- coding: utf-8 -*- | |
source 'http://rubygems.org' | |
gem 'rails', '3.2.15' | |
gem 'mysql2' | |
gem 'unicorn' | |
gem 'rabl' | |
gem 'i18n-js' | |
gem 'roadie' | |
gem 'kaminari' |
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 | |
echo "gem search -d ^${1}$" | |
gem search -d ^${1}$ |
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 | |
echo "gem search -da ^${1}$" | |
gem search -da ^${1}$ |
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
# -*- coding: utf-8 -*- | |
require 'voice_text_api' | |
require 'tempfile' | |
# https://github.com/tdtds/voice_text_api | |
vt = VoiceTextAPI.new('YOUR_API_KEY') | |
# wav = vt.tts('隣の客はよく柿食う客だ', :haruka, emotion: :happiness) | |
wav = vt.tts('隣の客はよく柿食う客だ', :haruka, emotion: :anger, emotion_level: 2) |
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
repositoryformatversion = 0 | |
filemode = true | |
bare = false | |
logallrefupdates = true | |
compression = 9 |
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
test: | |
pre: | |
- "export PULL_REQUEST_ID=`bundle exec prid willnet/savanna` && if [ $PULL_REQUEST_ID ]; then cd .. && git clone git@github.com:willnet/savanna.git for_pronto && cd for_pronto && git checkout -b ${CIRCLE_BRANCH} remotes/origin/${CIRCLE_BRANCH} && bundle install && PULL_REQUEST_ID=`bundle exec prid willnet/savanna` bundle exec pronto run -c master -f github_pr && cd ../savanna; else echo 'current branch is not pull request'; fi" |
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
# | |
# brew install imagemagick exiftool | |
# | |
system('convert -size 128x128 xc:blue test.jpg') | |
file_size = 1_048_576 - 448 | |
ascii = ('a'..'z').to_a + ('A'..'Z').to_a + ('0'..'9').to_a | |
File.open('random.txt', 'w') do |file| | |
file.write(file_size.times.map { ascii.sample }.join) |
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
#!/usr/bin/env ruby | |
# -*- coding: utf-8 -*- | |
# ログローテーションでできた古いログファイルを整理するためのスクリプト | |
# script/runner で実行する | |
Dir.chdir(RAILS_ROOT + "/log") | |
today = DateTime.now.strftime("%Y%m%d") | |
thismonth = DateTime.now.strftime("%Y%m") | |
Dir.glob("*").each do |filename| |
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
#!/usr/bin/env ruby | |
# ActiveRecordで管理している古いsessionを削除するスクリプト | |
# デフォルトで14日以上前のレコードを削除 | |
ENV["RAILS_ENV"] ||= "production" | |
require File.dirname(__FILE__) + '/../config/boot' | |
require File.dirname(__FILE__) + '/../config/environment' | |
num = ARGV.shift || 14 | |
num = num.to_i | |
# puts RAILS_ENV |
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
# | |
# log rotatation | |
# | |
# script/runner & cron で実行する | |
SERVER_PID = configatron.server.pid | |
ACCESS_LOG = configatron.server.access_log | |
ACCESS_LOG_STRFTIME = configatron.server.access_log_strftime | |
RAILS_LOG = configatron.server.rails_log | |
RAILS_LOG_STRFTIME = configatron.server.rails_log_strftime |
OlderNewer