Skip to content

Instantly share code, notes, and snippets.

View gecko655's full-sized avatar
🍅
アウトロが終わるとページをめくるたびにドキドキピルエット

YAMAMORI, Akihiro gecko655

🍅
アウトロが終わるとページをめくるたびにドキドキピルエット
View GitHub Profile
@gecko655
gecko655 / aikatsu_story.sh
Last active May 16, 2019 02:59
今週のアイカツフレンズ!
#!/bin/bash
# moved to https://github.com/gecko655/homebrew-aikatsu-story
if [ $# -lt 1 ] ; then
echo "usage: $0 episode-id"
exit 1
fi
episode_id=`printf %03d $1`
@gecko655
gecko655 / so_far_on_aikatsu_friends_exclamation.sh
Created March 2, 2019 15:58
これまでのアイカツフレンズ!
curl "http://www.aikatsu.net/story/story-[001-047].html" | \
pup '.story-waku-menu > :nth-child(2) json{}' | \
jq '.[].text'
@gecko655
gecko655 / chouseisan.rb
Created December 1, 2018 12:05
特定日から特定日までの土日祝日を、指定した時刻と共に表示するスクリプト
require 'date'
require 'holiday_japan'
start_date='2018-12-22'
end_date='2019-05-01'
time=['09:00〜12:00', '13:00〜17:00', '18:00〜22:00']
(Date.parse(start_date)..Date.parse(end_date))\
.select{|d| d.sunday? || d.saturday? || HolidayJapan.check(d)}\
.map{ |d| "#{d.year}/#{d.month}/#{d.day}"}\
@gecko655
gecko655 / git-clone-and-cd.sh
Created October 12, 2018 16:41
他のプロセスが居るとしぬ
git-clone-and-cd() {
before=`ls -1`
git clone "$1"
cd `diff --new-line-format="%L" \
--old-line-format="" \
--unchanged-line-format="" \
<(echo "$before") <(ls -1)`
}
# Slack team内で最近発言されたチャンネルだけをリストアップするやつ
# channels.listのページングは何も考えてない。1000くらいなら取れるっぽい。
TOKEN='xoxp-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' #slack regacy|user|bot token
curl 'https://slack.com/api/channels.list?token='$TOKEN'&exclude_archived=true&exclude_members=true&limit=1000' > tmp
for row in `cat tmp | jq -r '.channels[] | .id +"," + .name'`
do
ch_id=`echo $row | cut -d',' -f 1`
date_raw=`curl 'https://slack.com/api/channels.history?token='$TOKEN'&channel='$ch_id'&count=100' | \
jq -r '[.messages[] | select(.subtype == 'null')][0] | .ts' | \ # find the last HUMAN-made post
@gecko655
gecko655 / 艦これHTML5実装記念.js
Last active August 25, 2018 13:03
艦これHTML5実装記念.js
//console contextを `index.php` (IP直書きのやつ)にセットしておくこと
//https://stackoverflow.com/questions/3275816/debugging-iframes-with-chrome-developer-tools
//Safariの場合 `htmlwrap` というのをさがせばよい
startTime = performance.now();
createjs.Ticker._getTime = () =>{
return startTime + (performance.now() - startTime) * 5;
}
createjs.Ticker.framerate = 60 / 5; //for saving CPU usage
@gecko655
gecko655 / shinystars_resetmarathon.js
Created April 25, 2018 10:51
シャなんちゃらかんちゃらスでリセマラを高速化するやつ
(function(JSON) {
regex=/characterId/;
var oldParse = JSON.parse;
JSON.parse = function newParse(str) {
if (str.match(regex)) {
str = str.replace(/"isNew":true/g, '"isNew":false');
console.log(str);
str = str.replace(/"rarity":4/g, '"rarity":2');
return oldParse(str);
@gecko655
gecko655 / slackpost.sh
Created May 8, 2017 06:03
bash (とsed (とperl……)) があれば動く
#!/bin/bash
# Usage: slackpost "<webhook_url>" "<channel>" "<username>" "<message>" ["<attached_message>"]
export LANG=ja_JP.utf8
# ------------
webhook_url=$1
if [[ $webhook_url == "" ]]
then
#!/bin/bash
DIFFCOMMAND=diff
MTEXTPIPECOMMAND="grep 'mText:' | perl -Xpne 's/\\\\u([0-9a-fA-F]{4})/chr(hex("'$1'"))/eg'"
if [ $# -lt 1 ] ; then
echo "usage: $0 [--mtext] [rev1] [rev2] filename"
exit 1
fi
@gecko655
gecko655 / git_lfs_diff.sh
Last active March 7, 2017 06:53
GitでLFS管理下ファイルのdiffを見るやつ
#!/bin/bash
DIFFCOMMAND=diff
if [ $# -lt 1 ] ; then
echo "usage: $0 [rev1] [rev2] filename"
exit 1
elif [ $# -eq 1 ] ; then
$DIFFCOMMAND <(git show HEAD:"${@:1}" | git lfs smudge) "${@:1}"
elif [ $# -eq 2 ] ; then
$DIFFCOMMAND <(git show $1:"${@:2}" | git lfs smudge) "${@:2}"