Skip to content

Instantly share code, notes, and snippets.

- version "v0.2"
+ version "v0.3"
$ git log -p v2.13.4..v2.14.0
commit 1cd87a600f51783f2908ea4085c6c596963013f2
Author: Evan Phoenix <evan@phx.io>
Date: Fri Sep 18 09:45:35 2015 -0700
Bump to 2.14.0
diff --git a/History.txt b/History.txt
index 60a2b93..d610532 100644
--- a/History.txt
var d = (new Date);
var s = document.createElement('script');
s.charset = 'UTF-8';
s.src = 'http://b.hatena.ne.jp/js/Hatena/Bookmark/let.js?' + d.getFullYear() + d.getMonth() + d.getDate();
(document.getElementsByTagName('head')[0] || document.body).appendChild(s);
@gosyujin
gosyujin / jekyll-to-hugo.rb
Last active August 29, 2015 14:22
Jekyllの記事をHugoの記事に変換する
Dir.entries("./").each do |e|
next if e == "."
next if e == ".."
year = e[0..3]
month = e[5..6]
day = e[8..9]
slug = "slug: \"#{e[11..-4]}\""
now = "date: \"#{year}-#{month}-#{day}T00:00:00+09:00\""
puts now
このフォーマット、または下位のバージョンを取り扱うことがで、
そして、上位のバージョンではエラーとして取り扱います(そうするべき)。
フォーマットバージョン 0 はありません。1から始めました。
/* We can handle this format or anything lower, and we (should) error
* on anything higher.
*
* There is no format version 0; we started with 1.
*
#!/usr/bin/env python
#
# change-svn-wc-format.py: Change the format of a Subversion working copy.
#
# ====================================================================
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
@gosyujin
gosyujin / byte_copy.rb
Created March 13, 2015 06:46
バイナリでちょっとずつコピー
# -*- encoding: utf-8 -*-
buff = 1024
infile = File.open("hello.exe", "rb")
outfile = File.open("../hello.exe", "wb")
trans_count = infile.size / buff
i = 0.0
trans_count.times do
infile.read(buff).each_byte do |c|
@gosyujin
gosyujin / output.txt
Last active August 29, 2015 14:16
rubyXLでExcelファイルを触るコード
>bundle exec ruby overwork.rb
てすと.xlsx を開く
A1, B1, A2, B2を読み込み
A B
1 うわがき 0,1
2 1,0 1,1
A0を上書き
てすと.xlsx を保存
@gosyujin
gosyujin / selenium_set_http_proxy_error.log
Last active August 29, 2015 14:07
ENV['http_proxy']にnil入れた場合(動く)と""入れた場合(このエラー) Windows 7, Ruby 1.9.3
C:/Rubies/Ruby-1.9.3/lib/ruby/1.9.1/uri/common.rb:146:in `split': bad URI(absolute but no path): http:// (URI::InvalidURIError)
from C:/Rubies/Ruby-1.9.3/lib/ruby/1.9.1/uri/common.rb:211:in `parse'
from C:/Rubies/Ruby-1.9.3/lib/ruby/1.9.1/uri/common.rb:747:in `parse'
from C:/work/intra/vendor/bundle/ruby/1.9.1/gems/selenium-webdriver-2.43.0/lib/selenium/webdriver/remote/http/default.rb:92:in `new_http_client'
from C:/work/intra/vendor/bundle/ruby/1.9.1/gems/selenium-webdriver-2.43.0/lib/selenium/webdriver/remote/http/default.rb:17:in `http'
from C:/work/intra/vendor/bundle/ruby/1.9.1/gems/selenium-webdriver-2.43.0/lib/selenium/webdriver/remote/http/default.rb:83:in `response_for'
from C:/work/intra/vendor/bundle/ruby/1.9.1/gems/selenium-webdriver-2.43.0/lib/selenium/webdriver/remote/http/default.rb:39:in `request'
from C:/work/intra/vendor/bundle/ruby/1.9.1/gems/selenium-webdriver-2.43.0/lib/selenium/webdriver/remote/http/common.rb:40:in `call'
f
@gosyujin
gosyujin / cron_create_issue.rb
Created September 22, 2014 09:47
save_updatesとcreate_issueを実行するスクリプト、かつ既に存在するファイルには何もしない
begin
puts 'rake save_updates'
`rake save_updates`
rescue => ex
puts ex
`rm -rf diff/_*`
`git checkout diff/*`
end
puts 'Already exists files checkout'