Skip to content

Instantly share code, notes, and snippets.

View gunyarakun's full-sized avatar

Tasuku SUENAGA a.k.a. gunyarakun gunyarakun

View GitHub Profile
git shortlog -sne | awk '{$1="";print}'
<!--
<script>
alert('aaa');
</script>
-->
<html>
<head>
<title>test</title>
<script>
document.addEventListener('DOMContentLoaded', function() {
@gunyarakun
gunyarakun / rails-td.md
Created May 31, 2016 02:54
RailsでTreasure Dataにデータを流してみようメモ

RailsでTreasure Dataにデータを流してみようメモ

前提

  • td-agent/fluentdに1ミリも詳しくないです
  • とりあえず最短で使ってみよう
  • Railsのログと、自前のイベントログをそれぞれ流したい的な用途

Railsアプリの中から任意のイベントログを出す

Google I/O 2016 Shuttle時間表 from/to San Francisco

ホテル

@gunyarakun
gunyarakun / mv.rb
Created April 25, 2016 05:32
ディレクトリ・ファイル名とファイルの中身のテキストを置換する
#!/usr/bin/env ruby
# encoding: utf-8
# ディレクトリ・ファイル名とファイルの中身のテキストを置換する
require 'fileutils'
require 'open3'
PATTERN = 'AF'
REPLACEMENT = 'TomboAF'
DRY_RUN = false
@gunyarakun
gunyarakun / Instruction.md
Last active March 24, 2016 17:25
MINI R52 (COOPER S) CVTオイル追加

MINI R52 COOPER Sエンジンチェックランプがついちゃったよ

現状

  • 2015/03/??: JOY AUTO SERVICEにて調査。OBD-IIツールによると、CVTのエラーだったということだ。
  • 2015/03/??: BMW MINIディーラー。CVTエラーということを伝えたら、全交換ということで、$12,000という見積もりを出されたようだ。
  • 2015/03/17: hagatさんに見てもらって、やっぱり漏れの原因を特定すべきじゃね?という話に
  • 2015/03/17: 車上げグッズを注文。スロープx4とウマx4(安全用)。
  • 2015/03/23: スロープで前輪だけ上げて見てみた。エンジンオイル漏れてるっぽい。CVTオイルは漏れてないようだ。
  • 2015/03/23: CVTオイル交換しようと、バッテリー外し方法をググった結果、バッテリーが弱いとCVTに不具合が出るという報告を見つけた。
@gunyarakun
gunyarakun / parse_storyboard.rb
Last active March 12, 2016 02:02
Parse storyboard for ibtool and extract nib path list to be generated
#!/usr/bin/env ruby
require 'rexml/document'
d = REXML::Document.new(File.read(ARGV[0]))
nib_list = []
d.elements.each('//*[@storyboardIdentifier]') do |e|
nib_list << e.attribute('storyboardIdentifier').to_s
if e.name.intern == :viewController
I've wrote the manual for "how to look after Kiki".
Fill food and water
1. Open the box put the sticker "cat food" near the auto-feeder and put the food in the box into the auto-feeder. After closing the lid of the auto-feeder, check the red indicator not blinking.
2. Fill water into the water dispenser.
Option: Clean the litter
3. Clean the litter box with a scoop and put the garbage into the cat litter disposal tower. Pull the board in the middle of the disposal tower to fall the piled garbage.
@gunyarakun
gunyarakun / idx_offset_change.rb
Last active December 30, 2015 18:39
.idx/.sub形式の字幕のオフセット時間をずらすスクリプト
#!/usr/bin/env ruby
if ARGV.length != 4
puts "#{$PROGRAM_NAME} in.idx out.idx secdiff ratio"
puts "ex.) #{$PROGRAM_NAME} in.idx out.idx 15.34 1.01"
exit(1)
end
in_path, out_path, time_diff, ratio = ARGV
time_diff = time_diff.to_f * 1000
@gunyarakun
gunyarakun / comment_to_lyric.py
Created November 15, 2015 17:36
m4a comment to lyric
#!/usr/bin/env python
import os
import sys
from mutagen.mp4 import MP4
def find_all_files(directory, ext):
for root, dirs, files in os.walk(directory):
for file in files:
if file.lower().endswith('.' + ext):
yield os.path.join(root, file)