Skip to content

Instantly share code, notes, and snippets.

View eggplants's full-sized avatar
🏠
Working from home

haruna eggplants

🏠
Working from home
View GitHub Profile
@eggplants
eggplants / d_data_and.csv
Created April 28, 2019 18:40
run from my smartphone
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 April 29, 2019 00:30
build local server
require "webrick"
Thread.start{
WEBrick::HTTPServer.new(DocumentRoot:".",
port:7777,BindAddress:"127.0.0.1").start
}
gets
[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
@eggplants
eggplants / add_pool_for_chrome_cache.cmd
Last active June 16, 2019 01:14
save in shell:sendto
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
#レコード数分の辞書
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 June 23, 2019 20:17
shell芸まとめ
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 June 23, 2019 22:52
学校の計算機環境にメモリ(キャッシュ用)付け足すやつ
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 June 23, 2019 22:53
cmdでcat -nしたくなったときの
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
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
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