Skip to content

Instantly share code, notes, and snippets.

View takahashim's full-sized avatar

Masayoshi Takahashi takahashim

View GitHub Profile

Keybase proof

I hereby claim:

  • I am takahashim on github.
  • I am takahashim (https://keybase.io/takahashim) on keybase.
  • I have a public key ASBn56J2GqVP86I5OQrBu0436lbw2bJvdwXS8DHhhpCM0go

To claim this, I am signing this object:

@takahashim
takahashim / decidim-comments.diff
Created November 7, 2022 10:00
git diff 4370eec49fdc6400c5603890c85c45a0e235d8d6 decidim-comments > decidim-comments.diff
diff --git a/decidim-comments/app/cells/decidim/comments/comments/show.erb b/decidim-comments/app/cells/decidim/comments/comments/show.erb
index 982366a..f21dc52 100644
--- a/decidim-comments/app/cells/decidim/comments/comments/show.erb
+++ b/decidim-comments/app/cells/decidim/comments/comments/show.erb
@@ -20,6 +20,11 @@
<%= cell("decidim/comments/comment_thread", comment, order: order) %>
<% end %>
</div>
+ <% if comment_limited? %>
+ <%= link_to commentable_path(limit: 0), class: "button primary expanded" do %>
@takahashim
takahashim / ja.yml
Created May 4, 2022 15:47
Faker::Lorem用単語ファイル(宮沢賢治『銀河鉄道の夜』から抜粋して作成)
ja:
faker:
lorem:
words:
- あいさつ
- あした
- あたらしい
- あたらしく
- あたり
- あたりまえ
require 'fileutils'
Dir.glob("lib/**/*.rb") do |file|
rbs_file = file.sub('lib/', 'sig/').sub(/\.rb$/, '.rbs')
FileUtils.mkdir_p(File.dirname(rbs_file))
puts "#{file} -> #{rbs_file}"
cmd = "rbs prototype rb #{file} > #{rbs_file}"
system(cmd)
end

ウクライナの人々を支援する方法 (How you can help the people in Ukraine)

(訳者注: この記事はドイツ・スイスのNGOで、ベラルーシやウクライナでの人権活動に取り組むLiberecoが公開していた記事「How you can help the people in Ukraine」を翻訳したものです。)

原文公開日: 2022年02月26日

ドイツ、スイス、オーストリアなどからでも、寄付以外にウクライナの人々を支援するさまざまな方法があります。

ウクライナの人々を直接的・間接的に支援するためのプラットフォームやイニシアティブを紹介し、海外からどのように支援することができるかを提案します。

@takahashim
takahashim / convert.rb
Last active November 26, 2021 03:30
青空文庫CSV変換(著者等を「;」区切りで1カラムにまとめたもの)
require 'csv'
# 0 1 2 3 4 5 5 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 43 44 45 46 50 51
# 作品ID,作品名,作品名読み,ソート用読み,副題,副題読み,原題,初出,分類番号,文字遣い種別,作品著作権フラグ,公開日,最終更新日,図書カードURL,人物ID,姓,名,姓読み,名読み,姓読みソート用,名読みソート用,姓ローマ字,名ローマ字,役割フラグ,生年月日,没年月日,人物著作権フラグ,底本名1,底本出版社名1,底本初版発行年1,入力に使用した版1,校正に使用した版1,底本の親本名1,底本の親本出版社名1,底本の親本初版発行年1,底本名2,底本出版社名2,底本初版発行年2,入力に使用した版2,校正に使用した版2,底本の親本名2,底本の親本出版社名2,底本の親本初版発行年2,入力者,校正者,テキストファイルURL,テキストファイル最終更新日,テキストファイル符号化方式,テキストファイル文字集合,テキストファイル修正回数,XHTML/HTMLファイルURL,XHTML/HTMLファイル最終更新日,XHTML/HTMLファイル符号化方式,XHTML/HTMLファイル文字集合,XHTML/HTMLファイル修正回数
# "059898","ウェストミンスター寺院","ウェストミンスターじいん","うえすとみんすたあしいん","","","","","NDC 933","新字新仮名","なし",2020-04-03,2020-03-28,"https://www.aozora.gr.jp/cards/001257/card59898.html","001257","アーヴィング","ワシントン","アーヴィング","ワシントン","ああういんく","わしんとん","Irving","Washington","著者","1783-04-03","
require 'yaml'
require 'json'
# make_diff_yaml.rb : generate config/locales/ja.yml to use Decidim v0.24.3
#
# Usage:
#
# git clone https://github.com/decidim/decidim
# cd decidim
# git checkout v0.24.3
diff --git a/benchmark/local.rb b/benchmark/local.rb
index c5bbe29..f89c742 100644
--- a/benchmark/local.rb
+++ b/benchmark/local.rb
@@ -162,8 +162,10 @@ def commenter_names
post = Post.create!(body: 'post')
user1 = User.create!(name: 'John')
user2 = User.create!(name: 'Jane')
-post.comments.create!(commenter: user1, body: 'Comment1')
-post.comments.create!(commenter: user2, body: 'Comment2')

コードの主な変更点 (2021-03-13)

.cloudformation/

AWSのCloudFormation用。

.ebextensions/

AWSのElasticBeanstalk用。

issues、PRについて

確かにおかしそう…? app/models/decidim/proposals/proposal_wizard_create_step_form.rb だけでは足りてないのかもしれません。

Crowdinの方は修正済み、decidim-cfjの方はまだ変更なし