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
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 / 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
@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 / 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

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

ホテル

@gunyarakun
gunyarakun / rails-td.md
Created May 31, 2016 02:54
RailsでTreasure Dataにデータを流してみようメモ

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

前提

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

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

<!--
<script>
alert('aaa');
</script>
-->
<html>
<head>
<title>test</title>
<script>
document.addEventListener('DOMContentLoaded', function() {
git shortlog -sne | awk '{$1="";print}'
#!/usr/bin/env python
# encoding: utf-8
import json
import urllib
import urllib2
import codecs
import time
from bs4 import BeautifulSoup
from datetime import datetime
import sys
@gunyarakun
gunyarakun / rename-exit-date.rb
Created January 27, 2017 21:58
Exif情報を使って年月日時間でファイル名をリネームするRubyスクリプト
#!/usr/bin/env ruby
# gem install exifr
require 'find'
require 'exifr'
require 'fileutils'
Find.find('.') do |path|
next if File.extname(path) != '.jpg'
exif = EXIFR::JPEG.new(path)
date = exif.date_time_original