This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #-*- encoding: utf-8 -*- | |
| Plugin.create(:renko_chan) do | |
| def find_repeat(str) | |
| t=String.new() | |
| for i in 1..(str.size) | |
| if str.index(t+str[i-1],i) then | |
| t+=str[i-1] | |
| end | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| if hash git 2>/dev/null;then | |
| git clone https://github.com/aki017/OpenRitsPen && | |
| cd OpenRitsPen | |
| elif hash wget 2>/dev/null;then | |
| wget https://github.com/aki017/OpenRitsPen/archive/master.zip --no-check-certificate && | |
| unzip master && | |
| cd OpenRitsPen-master | |
| else | |
| echo "error: git or wget is not installed in your computer. Aborting." |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Plugin.create(:target_fav) do | |
| on_update do |svc, rawmsgs| | |
| msgs = Plugin.filtering(:show_filter, rawmsgs.select{|m| m.user.idname == 'syusui_s' and m.favoritable? and m[:created] > DEFINED_TIME}).first | |
| if not msgs.empty? then msgs.each{|m| m.favorite(true);} end end end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| NOWDIR=$PWD | |
| cd ./ # target directory | |
| if ls | grep .mp3 &> /dev/null ;then | |
| SONGRAND=$(expr $RANDOM % $(ls -1 *.mp3 | wc -l) + 1) | |
| mpg123 "$(ls -1 *.mp3 | awk 'NR=='$SONGRAND'{ print $0 }')" | |
| else | |
| exit 1 | |
| fi |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # -*- conding: utf-8 -*- | |
| Plugin.create(:presenter_sort_battery) do | |
| hash = {} | |
| on_endpresen do |service| | |
| if not hash.empty? | |
| sorted = hash.sort | |
| idname = sorted[0][0] | |
| service.update(:message => "@#{idname.to_s} next is your turn") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var schedule = new Array(); | |
| rows=document.getElementsByClassName("schedule_box")[0].rows; | |
| for(var i=1;i<rows.length;i+=2){ | |
| cells=rows[i].cells; | |
| var days=new Array(); | |
| for(var j=1;j<cells.length;j++){ | |
| days.push(cells[j].textContent.replace(/\s/g, '')); | |
| } | |
| schedule.push(days); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # -*- coding: utf-8 -*- | |
| Plugin.create(:eject_huurin) do | |
| UserConfig[:eject_huurin_lock] ||= false | |
| def optEject | |
| if not UserConfig[:eject_huurin_lock] then | |
| UserConfig[:eject_huurin_lock] = true | |
| system("eject /dev/sr0;sleep 1;eject -t /dev/sr0") | |
| UserConfig[:eject_huurin_lock] = false |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ary = [8,2,3,7,1,2,5,7,8,3,5,6] | |
| result = [] | |
| threads = [] | |
| ary.each{|e| | |
| threads.push Thread.new{ | |
| sleep e | |
| result.push e | |
| } | |
| } | |
| loop do |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ary = [9,2,4,5,1,2,4,5,1,8] | |
| def is_sorted?(array) | |
| arr = array.clone | |
| fst = arr.pop | |
| while not arr.empty? and fst >= (nxt=arr.pop) | |
| fst = nxt | |
| end | |
| return (arr.empty? and fst >= nxt) ? true : false | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| search :: [Char] -> [Char] -> Bool | |
| search [] _ = False | |
| search _ [] = False | |
| search a b | |
| | str == b = True | |
| | str /= b = search (tail a) b | |
| where str = take (length b) a |