Skip to content

Instantly share code, notes, and snippets.

View willnet's full-sized avatar
🏠
Working from home

Shinichi Maeshima willnet

🏠
Working from home
View GitHub Profile
@willnet
willnet / gem-info-all
Created July 1, 2014 07:51
gem-info-all
#!/bin/sh
echo "gem search -da ^${1}$"
gem search -da ^${1}$
# -*- 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)
repositoryformatversion = 0
filemode = true
bare = false
logallrefupdates = true
compression = 9
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"
@willnet
willnet / create_image.rb
Created March 27, 2015 11:59
create image whose file size you can specify for test
#
# 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)
begin
require 'bundler/inline'
rescue LoadError => e
$stderr.puts 'Bundler version 1.10 or later is required. Please update your Bundler'
raise e
end
gemfile(true) do
source 'https://rubygems.org'
# Activate the gem you are reporting the issue against.
begin
require 'bundler/inline'
rescue LoadError => e
$stderr.puts 'Bundler version 1.10 or later is required. Please update your Bundler'
raise e
end
gemfile(true) do
source 'https://rubygems.org'
# Activate the gem you are reporting the issue against.
@willnet
willnet / gist:a67beba9a9f19cfd7d06f055a38c11f5
Created May 8, 2016 12:00
Ruby の thread とクロージャ
require 'thread'
hash = {}
a = Thread.new do
connection = 'A'
hash[:a] = -> { puts connection }
end
@willnet
willnet / be_a_rails_contributer.md
Last active August 21, 2023 05:44
Railsコントリビュータへの道

これはなに

  • Railsにプルリクストを送るときに知っておくと便利なお作法集
  • Railsにプルリクエストを送りたいけど何から始めたらいいのかわからない人向けの指針

お作法についてはRuby on Rails に貢献する方法 | Rails ガイドを参考にしています。

前提知識

Railsのコードを読むには、最低限次の二つの知識があったほうがよいです