Skip to content

Instantly share code, notes, and snippets.

Coro365 / myDays.rb
Last active August 29, 2015 14:04
Calendar copy to clipboard
View myDays.rb
year = ARGV[0].to_i
mounth = ARGV[1].to_i
number = ARGV[2].to_i
#week set
week = ["Sum","Mon","Tue","Wed","Thu","Fri","Sta"]
#last day set
limits = [31,28,31,30,31,30,31,31,30,31,30,31]
limit = limits[mounth - 1]
Coro365 / switch-control.ino
Created May 2, 2015 16:24
It receives the serial signals to control the switches.
View switch-control.ino
#include <Servo.h>
#define BUTTON1_PIN 7
#define BUTTON2_PIN 8
#define SERVO1_PIN 9
#define SERVO2_PIN 10
#define ACTION_NUM 4
//servo set
#define RIGHT 135
Coro365 / goNextEpisode.applescript
Last active February 26, 2016 13:00
This applescript will automatically play the episode of the next iTunes TV show.
View goNextEpisode.applescript
--Version 20150808
--This applescript will automatically play the episode of the next iTunes TV show.
--Please select Japanese or English. (comment out "--")
--Please export application format. (File > Export > File type > Application > Save)
--This version does not support the jump from the last episode to within three minutes of the place.
--Author is coro (
on run {}
tell application "iTunes" to activate
View diff_upload.rb
require 'fileutils'
PATH = ""
NAME = File.basename(PATH)
TEMP_NAME = "#{NAME}.sum"
for server_path in $@
# mkv to mp4
for FILE in ${DIRPATH}/*.mkv
echo ${FILE}
ffmpeg -i "${FILE}" -vcodec copy "${FILE%.mkv}.mp4"
Coro365 / reg_rename.rb
Last active August 24, 2016 07:57
file name edit in regular expression
View reg_rename.rb
require "find"
Dir[File.dirname(__FILE__) + "/com_lib/*.rb"].each {|file| require file}
def yesno?(ms = "")
blue "#{ms}\nPlease press y/n\n> "
i = STDIN.gets
if /^y$|^Y$|^yes$|^Yes$|^YES$/ =~ i
return true
elsif /^n$|^N$|^no$|^No$|^NO$/ =~ i
Coro365 / auto_encode.rb
Last active October 25, 2017 16:14
Encode the recorded m2ts file
View auto_encode.rb
require 'fileutils'
require 'shellwords'
WD = File.dirname(File.expand_path(__FILE__))
TSDIR = "path"
MP4DIR = "path"
def recodeing? (ts)
s1 = File.size(ts)
sleep 1
Coro365 / animetick_counter.rb
Created November 10, 2017 17:02
watch anime count in
View animetick_counter.rb
require "pp"
require "open-uri"
require "nokogiri"
@userid = "Coro365"
@crawl_page_number = 26
@animetick_subscribes =
def animetick_crawl(page_number)
url = "{@userid}?page=#{page_number}"
Coro365 / waifu2x-wrapper.rb
Last active March 10, 2021 12:25
This script can process multiple files and directories with waifu2x-converter-cpp
View waifu2x-wrapper.rb
# Dipendency waifu2x and imagemagic
require 'Open3'
require 'fileutils'
require 'ruby-progressbar'
require "#{__dir__}/get_files_from_ARGV.rb"
require "#{__dir__}/natural_sort.rb"
include Natural_sort