Skip to content

Instantly share code, notes, and snippets.

View PharaohKJ's full-sized avatar
👺
Ten-goods come on! Working from home

ふぁらお加藤 PharaohKJ

👺
Ten-goods come on! Working from home
View GitHub Profile
@PharaohKJ
PharaohKJ / gist:a77add4777aa0f5934340936711a0652
Created March 12, 2024 06:44
ImageMagickでいただいたロゴを比率を保ったまま幅240にして320x240で余白埋め画像を作成する
convert target-logo.png -resize 240 -gravity center -extent 320x240 resized-logo.png
files = Dir.entries('./').reject{ |x| x.include?('resized') }.select { |x| x.include?('mp4') }
files.each do |fname|
size = 240
cmd = %Q[ffmpeg -y -i '#{fname}' -vf scale=#{size}\:0 '#{fname}resized-#{size}.mp4']
cmd = %Q[ffmpeg -y -i '#{fname}' -vf scale=#{size}\:140 '#{fname}resized-#{size}.mp4']
puts cmd
system(cmd)
end
from contextlib import contextmanager
@contextmanager
def context():
print("enter")
try:
print("try")
yield
except Exception as e:
print("except")
mememe {
--c1: rgb(255, 253, 85);
--c2: rgb( 41, 44, 57);
--c3: rgb(255, 1, 115);
--c4: rgb( 94, 235, 51);
--c5: rgb(252, 177, 59);
--c6: rgb(161, 241, 235);
--c7: rgb(255, 255, 255);
}
  • 発行者名・・・書類の作成者の氏名又は名称
  • 日付・・・課税資産の譲渡等を行った年月日
  • 但し書き・・・課税資産の譲渡等に係る資産又は役務の内容
  • 金額・・・課税資産の譲渡等の対価の額
  • 受取人名・・・書類の交付を受ける当該事業者の氏名又は名称(少額、または小売業等 は省略可)
@PharaohKJ
PharaohKJ / gmail_opener.rb
Last active May 4, 2020 02:00
Open GMail on MacOS with Ruby
uid = 0
params = URI.encode_www_form(
[
['view', 'cm'],
['su', subject],
['to', to],
['body', doc],
['cc', cc],
['bcc', bcc]
]
@PharaohKJ
PharaohKJ / remove_merged_branch.rb
Last active July 13, 2023 20:57
remove merged branch
`git branch --merged`.split(/\R/).map(&:strip).reject { |r| r[0] == '*' || r == 'master' || r == 'main' }.each { |r| system "git branch --delete #{r}" }
`git branch --all --merged remotes/origin/main`.split(/\R/).map(&:strip).reject { |r| r[0]
== '*' || r == 'master' || r == 'main' }.each { |r| system "git push --delete origin #{r.gsub('remotes/ori
gin/', '')}" }
@PharaohKJ
PharaohKJ / wgets-sample-images.rb
Last active December 1, 2019 11:21
placehold.jp さんを利用してサンプル画像ファイルを作成しまくる
%w[
160x90
160x120
320x180
320x240
640x360
640x480
1280x720
1280x960
].each do |size|
@PharaohKJ
PharaohKJ / capybara cheat sheet
Created March 14, 2019 11:10 — forked from zhengjia/capybara cheat sheet
capybara cheat sheet
=Navigating=
visit('/projects')
visit(post_comments_path(post))
=Clicking links and buttons=
click_link('id-of-link')
click_link('Link Text')
click_button('Save')
click('Link Text') # Click either a link or a button
click('Button Value')
@PharaohKJ
PharaohKJ / capybara-with-minitest-cheatsheet.md
Last active March 12, 2019 09:49
test:system (capybara) オレオレチートシート

ツール

https://github.com/mugi-uno/nezumi

入力

    fill_in 'staff_password', with: 'password'
    click_on 'LOGIN'
 find_button('発注する').click # findでみつかるまでwaitが入る模様 -> see https://www.rubydoc.info/github/jnicklas/capybara/Capybara%2FNode%2FFinders:find_button