Skip to content

Instantly share code, notes, and snippets.

@onk
onk / .rubocop.yml
Last active January 15, 2018 02:30
僕の使っている .rubocop.yml
# rubocop v0.35.0 から inherit_gem という機能が増えたので gem にしました
# https://github.com/onk/onkcop
inherit_gem:
onkcop: "config/rubocop.yml"

freee API v1.0

全自動クラウド会計ソフトfreeeの開発者向けAPIのドキュメントです。

概要

本APIを利用することで、あなたのアプリやサービスをfreeeと連携させることができます。

提供機能(2013/10/10現在)

@ogijun
ogijun / gist:1869060
Created February 20, 2012 12:48
Guessing the encoding of given string by trying only Japanese major encodings.
def ugly_guess_jp str
%w[UTF-8 EUC-JP Shift_JIS eucJP-ms Windows-31J].find do |encoding|
begin
tested = str.force_encoding(encoding)
tested.valid_encoding? && tested.encode('UTF-8').valid_encoding?
rescue Encoding::UndefinedConversionError => e
nil
end
end
end