Skip to content
{{ message }}

Instantly share code, notes, and snippets.

# Hiroshi Yuki hyuki0000

Created Jun 18, 2017
Mastodon 1.3.3 -> 1.4.3 でエラー
View error.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
 $docker-compose pull$ docker-compose build $docker-compose run --rm web rails db:migrate$ docker-compose run --rm web rails mastodon:maintenance:prepare_for_foreign_keys $docker-compose run --rm web rails db:migrate$ docker-compose run --rm web rails assets:precompile Creating mastodon user (UID : 1000 and GID : 1000)... Updating permissions... Executing process... yarn install v0.24.5
Last active Jan 19, 2018
TipmonaTipBookmarklet.js - Pay monacoin via @tipmona
View TipmonaTipBookmarklet.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
 /* * TipmonaTipBookmarklet.js * * When you see * https://twitter.com/EXAMPLEUSER/... * Then you jump to * https://twitter.com/intent/tweet?text=@tipmona%20tip%20@EXAMPLEUSER%201%20Mona%20を贈ります。 * And when you see * https://twitter.com/EXAMPLEUSER/status/xxxxxxxx * Then you jump to
Created Jun 2, 2017

View girlnote150.tex
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
 数列$\{a_n\}$と$\{b_n\}$を、 \left\{ \begin{align*} a_0 &= \dfrac{1}{2\pi} \int_{0}^{2\pi} f(x) \,dx \\ b_0 &= 0 \phantom{\int_{0}^{2\pi}}\\ a_n &= \dfrac{1}{\pi} \int_{0}^{2\pi} f(x)\cos nx \,dx & (n = 1,2,3,\ldots)\\ b_n &= \dfrac{1}{\pi} \int_{0}^{2\pi} f(x)\sin nx \,dx \\ \end{align*} \right. Created Jun 2, 2017 正の整数の分類 View positive.tex This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters  ￼ nを正の整数とする。nを割り切る正の整数が1個しかないとき、nを単数という。ちょうど2個あるとき、nを素数という。3個以上あるとき、nを合成数という。 \begin{array}{|c|c|c|c|c|c|c|c|c|c} \hline \textbf{単数} & 1 & & & & & & & & & & \\ \hline \textbf{素数} & & 2 & 3 & & 5 & & 7 & & & & \\ \hline \textbf{合成数} & & & & 4 & & 6 & & 8 & 9 & 10 & \\
Last active Feb 24, 2018
mov-to-gif - .movからanimation GIFを作る
View mov-to-gif.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
 #!/usr/bin/env ruby require 'tmpdir' if ARGV.length != 3 puts "mov-to-gif: Create animation GIF" puts "Usage: mov-to-gif 1 input.mov output.gif -- normal (x1)" puts "Usage: mov-to-gif 2 input.mov output.gif -- faster (x2)" puts "Usage: mov-to-gif 0.5 input.mov output.gif -- slower (x0.5)" abort
Created May 28, 2017
makeapp - スクリプトをMacのアプリケーションにする
View makeapp.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
 #!/usr/bin/env ruby # cf. http://bit.ly/2raKfLZ # makeapp - スクリプトをMacのアプリケーションにする if ARGV.length != 2 abort("Usage: makeapp foo.rb Foo.app") end scriptname = ARGV[0] appname = ARGV[1]
Created May 27, 2017
transpoint - Twitterにpng画像をアップロードするときにjpeg圧縮が掛からないように右下隅の1ピクセルを透明にする
View transpoint.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
 #!/usr/bin/env ruby # http://www.mk-mode.com/octopress/2013/08/28/ruby-write-character-by-rmagick/ # http://www.gesource.jp/weblog/?p=194 # transpoint - Twitterにpng画像をアップロードするときにjpeg圧縮が掛からないように右下隅の1ピクセルを透明にする require 'fileutils' require 'RMagick' def transpoint(image_filename) image = Magick::ImageList.new(image_filename)
Created May 16, 2017
nowtex.sh - 「いつメモするの？　今でしょ！」的なシェルスクリプト
View nowtex.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
 vi ruby -e 'puts Time.now.strftime("%Y%m%d%H%M%S")'.tex
Created May 13, 2017
get-title - URLを与えると、そのページのURLとタイトルをいろんな形式で出力する
View get-title.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
 #! /usr/bin/env ruby require 'mechanize' if ARGV.length != 1 abort("Usage: get-title URL") end url = ARGV[0] agent = Mechanize.new
Created May 13, 2017
mechanize-sample
View mechanize-sample.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
 #! /usr/bin/env ruby require 'mechanize' require 'nokogiri' agent = Mechanize.new page1 = agent.get('https://www.google.co.jp') form = page1.forms[0] form.q = 'Sports' page2 = agent.submit(form)