Skip to content

Instantly share code, notes, and snippets.

View takahashim's full-sized avatar

Masayoshi Takahashi takahashim

View GitHub Profile

青空文庫テキストファイル用Shift_JISとUnicodeとの変換定義(私案)

本文書は、青空文庫で配布されているテキストファイルをUnicodeに変換する規則、またUnicodeで入力されたテキストファイルを青空文庫テキストファイル用のShift_JISのファイルに変換する規則を提案する。

動機

青空文庫テキストファイルはJIS X 0208のShift_JISで記述されているが、Unicodeに相互変換したいというニーズがある。

  • UTF-8で入力・出力したい
  • UTF-8に対応したツールを使いたい
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日

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

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