Skip to content

Instantly share code, notes, and snippets.

@kiwofusi
kiwofusi / about
Last active January 28, 2020 11:16
YouTubeのチャット欄のモデレータのコメントを見やすくするブックマークレット
javascript:for (const msg of document.querySelector('#chatframe').contentWindow.document.querySelectorAll('yt-live-chat-text-message-renderer')) { if (msg.getAttribute('author-type') === 'moderator') { document.querySelector('#chatframe').contentWindow.document.querySelector('#item-scroller.animated.yt-live-chat-item-list-renderer #items').append(msg); } }
上の文字列をブックマークして実行するとモデレータのコメントが一番下に移動します。
@kiwofusi
kiwofusi / アメブロ省入力.mac
Last active August 29, 2015 14:19
アメブロ書くときに使う自分用記法を変換する秀丸マクロ
// 秀丸マクロ
// アメブロを書くときの自分用記法
// 使い方:このマクロを実行すると以下の記法に当てはまるところがアメブロ用のHTMLになる。ファイル全体を置換する
// ※Shift-JISで保存しないと動かないです
//
// {hoge}
// ->ピンク(僕は人名に使ってる)
// <font color="#EE82EE">hoge</font>
//
// {「hoge」}
@kiwofusi
kiwofusi / 2janaiyo_lst.rb
Created July 6, 2014 02:47
2じゃないよURL書き出し
# coding: utf-8
require 'open-uri'
lst = "C:/どこどこ/2.lst"
url = "http://radio.commufa.jp/tokai/ske/"
open(url) do |content|
open(lst, "w") do |f|
@kiwofusi
kiwofusi / file_num_count.rb
Created July 6, 2014 02:01
ファイル数カウント
# coding: utf-8
require 'date'
def count_file(count_dir, log_file)
# ファイルの先頭に書き足すのがスパッとできないのでこういう書き方に
open(log_file, "a").close()
open(log_file, "r+") do |f|
f.puts (DateTime.now+1).strftime("%Y/%m/%d") + "," + Dir::glob(count_dir + "/**/*.*").count.to_s
f.print open(log_file).read
@kiwofusi
kiwofusi / c.bat
Created November 14, 2011 20:33
RailsInstaller付属のRubyのirbが妙に重い件
rails console --sandbox -- --noreadline
@kiwofusi
kiwofusi / エラーログ
Created November 11, 2011 19:11
herokuにweb-app-themeを使ったアプリを上げたときのエラー
Rendered public/help.html.erb within layouts/application (138.8ms)
Completed 500 Internal Server Error in 426ms
ActionView::Template::Error (Permission denied - /app/public/stylesheets/.permissions_check.70310602512700.1.498761):
2: <html>
3: <head>
4: <title>タイトル</title>
5: <%= stylesheet_link_tag "web-app-theme/base", "web-app-theme/themes/default/style", "web-app-theme/override", :cache => true %>
6: <%= javascript_include_tag :defaults, :cache => true %>
7: <%= csrf_meta_tag %>
@kiwofusi
kiwofusi / gist.rb
Created November 8, 2011 09:57
Gistを使ってみる
class Gist
# ぎすと? じすと?
end