Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View takahashim's full-sized avatar

Masayoshi Takahashi takahashim

View GitHub Profile
diff -uwbNr decidim-cfj/config/application.rb decidim/development_app/config/application.rb
--- decidim-cfj/config/application.rb 2023-07-03 17:49:30
+++ decidim/development_app/config/application.rb 2023-08-21 23:24:55
@@ -1,37 +1,22 @@
-# frozen_string_literal: true
-
require_relative "boot"
-require "decidim/rails"
-# Add the frameworks used by your app that are not loaded by Decidim.
# Be sure to restart your server when you modify this file.
# Your secret key is used for verifying the integrity of signed cookies.
# If you change this key, all old signed cookies will become invalid!
# Make sure the secret is at least 30 characters and all random,
# no regular words or you'll be exposed to dictionary attacks.
# You can use `rails secret` to generate a secure secret key.
# Make sure the secrets in this file are kept private
# Be sure to restart your server when you modify this file.
# Your secret key is used for verifying the integrity of signed cookies.
# If you change this key, all old signed cookies will become invalid!
# Make sure the secret is at least 30 characters and all random,
# no regular words or you will be exposed to dictionary attacks.
# You can use `rails secret` to generate a secure secret key.
# Make sure the secrets in this file are kept private
import puppeteer from 'puppeteer';
const browser = await puppeteer.launch();
const page = await browser.newPage();
await page.goto('https://www.kdpcommunity.com/s/announcement-archive?language=ja', { waitUntil: 'networkidle0' });
const src = await page.content();
console.log(src);
await browser.close();

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","