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 |
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 |
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. |
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$を<b>単数</b>という。ちょうど$2$個あるとき、$n$を<b>素数</b>という。$3$個以上あるとき、$n$を<b>合成数</b>という。 | |
$$ | |
\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 & \\ |
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 |
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] |
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) |
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 |
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 |
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) |