Skip to content

Instantly share code, notes, and snippets.

View kyanny's full-sized avatar

Kensuke Nagae kyanny

View GitHub Profile
#!/usr/bin/env ruby
# Usage
# $ ruby tools/table.rb
require 'terminal-table'
def make_table rank
headings = [ rank.upcase ]
qs = eval(File.read("tools/#{rank}.txt")).to_a
rows = qs.map { |q|
[q]
copy(
$$('.problem-group .problem-box__header__title').map(function(el){ return el.textContent.split(/:/)[0] })
)
require 'thread'
V = Struct.new(:x, :y, :visited, :goal)
m = []
$w = 10
$h = 10
$h.times do |h|
l = []
@kyanny
kyanny / a.el
Created January 17, 2019 12:02
(let* ((elapsed
(float-time
(time-subtract
(date-to-time "2019-01-17 18:05")
(date-to-time "2019-01-17 13:19"))))
(in_minutes (/ elapsed 60))
(in_hours (/ in_minutes 60))
(remained_minutes (mod in_minutes 60)))
(format "%d hours %d minutes" in_hours remained_minutes))
var current = null;
var originalStyle = '';
document.onmouseover = function(e) {
current = document.elementFromPoint(e.clientX, e.clientY);
originalStyle = current.style;
current.style = 'background: rgba(255, 0, 0, 0.2)';
if (window.speechSynthesis) {
var synth = speechSynthesis;
var message = current.textContent;
@kyanny
kyanny / gist:275a9fb8e2735caeb6ebdfea3bb9f426
Created September 17, 2018 17:59
二十世紀ボヤージ(スクリーンセーバー)で流れる名言の一覧 / The historical messages from the 20th century voyage (screen saver)
戦後の一時期に比べれば、その欲望の熾烈さは明らかに減少した。もはや戦後ではない_1947年経済白書
プロパガンダとは大衆の感情に訴えて、彼らの想像力を呼び起こし、国民大衆の心を引きつけることにある_アドルフ・ヒトラー
科学的な説明は知識人のためにあり、宣伝という近代的な武器は大衆に対するものだ_アドルフ・ヒトラー
永遠に選択が行われ、強者が常に生命を維持し、かつ生きる権利をも保持するのであり、弱者は滅んでいく_アドルフ・ヒトラー
思考とは驚きからの絶えざる飛翔である_アルバート・アインシュタイン
もし光の速度で光を追いかけたなら、光は止まって見えるだろうか?_アルバート・アインシュタイン
ぼくはいつも残り物で残り物のことをするのが好き_アンディ・ウォーホル
お金はぼくにとってその瞬間なんだ。お金はぼくのムード_アンディ・ウォーホル
ぼくは考え出したら絵はもうダメになると思う_アンディ・ウォーホル
コークはコーク、どれだけお金があっても街角のホームレスが飲んでいるものよりおいしいコークなんて買えない_アンディ・ウォーホル
2222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222
@kyanny
kyanny / user.css
Created January 26, 2018 11:49
GitHub通知で選択中の行を強調する
@-moz-document url-prefix("https://github.com/notifications"), url-prefix("https://github.com/notifications/participating"), regexp("https://github.com/.*/notifications.*") {
.list-group-item.navigation-focus {
outline: 1px black dashed;
}
}
@kyanny
kyanny / -
Created January 23, 2018 14:20
hello