Skip to content

Instantly share code, notes, and snippets.

@Coro365
Coro365 / myDays.rb
Last active August 29, 2015 14:04
Calendar copy to clipboard
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
Coro365 / switch-control.ino
Created May 2, 2015 16:24
It receives the serial signals to control the switches.
#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
Coro365 / goNextEpisode.applescript
Last active February 26, 2016 13:00
This applescript will automatically play the episode of the next iTunes TV show.
--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 (http://coro3.net)
on run {}
tell application "iTunes" to activate
repeat
require 'fileutils'
#前回upしたものと同じでなければupする
PATH = ""
NAME = File.basename(PATH)
TEMP_NAME = "#{NAME}.sum"
TEMP_DIR = ""
#!/bin/sh
mount(){
USER="NAS_USER_NAME"
ADDRESS="readynas104.local"
PASSWD="PASSWD"
for server_path in $@
do
mount_path=/Volumes/${server_path}
# mkv to mp4
DIRPATH=$1
for FILE in ${DIRPATH}/*.mkv
do
echo ${FILE}
ffmpeg -i "${FILE}" -vcodec copy "${FILE%.mkv}.mp4"
done
@Coro365
Coro365 / reg_rename.rb
Last active August 24, 2016 07:57
file name edit in regular expression
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
Coro365 / auto_encode.rb
Last active October 25, 2017 16:14
Encode the recorded m2ts file
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
Coro365 / animetick_counter.rb
Created November 10, 2017 17:02
watch anime count in animetick.net
require "pp"
require "open-uri"
require "nokogiri"
@userid = "Coro365"
@crawl_page_number = 26
@animetick_subscribes = Array.new
def animetick_crawl(page_number)
url = "http://animetick.net/users/#{@userid}?page=#{page_number}"
@Coro365
Coro365 / waifu2x-wrapper.rb
Last active March 10, 2021 12:25
This script can process multiple files and directories with waifu2x-converter-cpp
# 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