Skip to content

Instantly share code, notes, and snippets.

@eggplants
eggplants / d_data_and.csv
Created Apr 28, 2019
run from my smartphone
View d_data_and.csv
id title episode
10001 とある魔術の禁書目録 24
10002 キノの旅-the Beautiful World- 13
10003 狼と香辛料 13
10004 乃木坂春香の秘密 12
10005 とらドラ! 25
10006 ケメコデラックス! 12
10007 狼と香辛料Ⅱ 12
10008 乃木坂春香の秘密 ぴゅあれっつぁ♪ 12
10009 デュラララ!! 24
@eggplants
eggplants / web-open.rb
Created Apr 29, 2019
build local server
View web-open.rb
require "webrick"
Thread.start{
WEBrick::HTTPServer.new(DocumentRoot:".",
port:7777,BindAddress:"127.0.0.1").start
}
gets
View ssh.desktop
[Desktop Entry]
Type=Application
Name[en_US]=icho
Terminal=true
X-KeepTerminal=true
Exec=ssh icho.u.tsukuba.ac.jp -l sxxxxxxx -i ~/.ssh/chimpo
Comment[en_US]=ssh
GenericName=ssh connect
GenericName[en_US]=ssh connect
Icon=/home/eggplant/Downloads/University_of_Tsukuba_emblem.svg
View add_pool_for_chrome_cache.cmd
net use P: \\sv-pool01\vol_pool01\pool /yes
set PATH=%PATH%;C:\Program Files (x86)\Google\Chrome\Application\
START "" chrome.exe -disk-cache-dir="P:\Cache"
exit
View kakou.rb
#レコード数分の辞書
wc_n=File.read('jbisc.txt').count('*')
data,i=Array.new(wc_n).map{Hash.new},0
duplicate = %w(ISBN NOTE TITLEHEADING AUTHORHEADING)
#Hash化
File.foreach("jbisc.txt"){|row|
row.chomp!
unless row=='*'
key=row.scan(/^([A-Z]+): /)[0][0]
unless duplicate.include?(key)
@eggplants
eggplants / loto_random1.sh
Last active Jun 23, 2019
shell芸まとめ
View loto_random1.sh
echo 明日買いに行く
s=7;t=$(echo 314337|cut -c $((s-4))-$((s-3)));a="$(for((i=0;i<${s};i++));do echo-sd $(shuf -i1-${t} -n1|awk '{printf("%02d",$1)}');done;echo-sd $(echo $s|ruby -e 'puts "ロト"*http://gets.to _i'))";echo $a|sed "s/ /\n/g"|lolcat -f|textimg -s
@eggplants
eggplants / adpool_mvchrome.cmd
Created Jun 23, 2019
学校の計算機環境にメモリ(キャッシュ用)付け足すやつ
View adpool_mvchrome.cmd
net use P: \\sv-pool01\vol_pool01\pool /yes
set PATH=%PATH%;C:\Program Files (x86)\Google\Chrome\Application\
START "" chrome.exe -disk-cache-dir="P:\Cache"
exit
@eggplants
eggplants / cmd-n.rb
Last active Jun 23, 2019
cmdでcat -nしたくなったときの
View cmd-n.rb
puts "error!: plz give me argument" if $*[0]==nil
exit if $*[0]==nil
if $*[1]==nil
n=[];(`findstr /N /R ".*" #{$*[0]}`).each_line.map{|a|n<< a}
/\d/=~"0";n.map{|b|puts b.sub(/(\d+):/, "#{"%03d" % ($&.to_i+1).to_s} :")}
else
`findstr /R ".*" #{$*[0]}`.each_line.map{|a|puts a}
end
View timer_down_2h.rb
require 'time'
o = Time.now
begin
loop do
dt = Time.at((n=Time.now)-o.to_i)
print (n-o).to_i%1800==0? 7.chr
: Time.at(Time.at(61200)-dt).strftime("LEFT TIME::{%Hh:%Mm:%Ss}")
print "\r"
sleep(1)
end
View timer_logintime.rb
require "time";o=Time.now;loop do;print (dt=Time.now-o).to_i%1800==0? 7.chr:Time.at(dt.to_i-32400).strftime("SPENT TIME::%Hh:%Mm:%Ss");p(\r);sleep(1);end