Skip to content

Instantly share code, notes, and snippets.

🏠
Working from home

Hiroshi Saito hiroshi

🏠
Working from home
Block or report user

Report or block hiroshi

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View gist:ed3143ef8a35d9398121708b33026a8d
[2019-07-26 07:36:03 +0000] [16] [application:test] exception: undefined method `new' for "UTF8Cleaner::Middleware":String
Did you mean? next
/bundle/ruby/2.4.0/gems/spring-2.0.2/lib/spring/application.rb:301:in `write': Input/output error (Errno::EIO)
from /bundle/ruby/2.4.0/gems/spring-2.0.2/lib/spring/application.rb:301:in `puts'
from /bundle/ruby/2.4.0/gems/spring-2.0.2/lib/spring/application.rb:301:in `print_exception'
from /bundle/ruby/2.4.0/gems/spring-2.0.2/lib/spring/application.rb:215:in `rescue in serve'
from /bundle/ruby/2.4.0/gems/spring-2.0.2/lib/spring/application.rb:226:in `serve'
from /bundle/ruby/2.4.0/gems/spring-2.0.2/lib/spring/application.rb:141:in `block in run'
from /bundle/ruby/2.4.0/gems/spring-2.0.2/lib/spring/application.rb:135:in `loop'
from /bundle/ruby/2.4.0/gems/spring-2.0.2/lib/spring/application.rb:135:in `run'
@hiroshi
hiroshi / README.md
Last active Nov 3, 2016
How to filter keys of i18n-js only used in .js files
View README.md
  1. Prerequisites

You must use i18n-tasks and make sure i18n-tasks health is OK. I recommend that running i18n-tasks health along with your tests in CI.

  1. Download i18n-tasks_js.rb as lib/i18n_tasks/js.rb in your project.

  2. Insert the line below into the top of config/i18n-tasks.yml

<% require './lib/i18n_tasks/js' %>
View keybase.md

Keybase proof

I hereby claim:

  • I am hiroshi on github.
  • I am hiroshi (https://keybase.io/hiroshi) on keybase.
  • I have a public key whose fingerprint is E9C7 8B16 9022 BC81 0A8B 2B2B FEA5 2188 3D72 D6FF

To claim this, I am signing this object:

View Makefile
# http://tmont.com/blargh/2014/1/uploading-to-s3-in-bash
# file=xxxx
# bucket=xxxx
# s3Key=xxxx
# s3Secret=xxxx
resource=/${bucket}/${file}
contentType=binary/octet-stream
dateValue := $(shell date "+%a, %d %b %Y %H:%M:%S %z")
SHELL=bash # Enable echo -ne option
signature:=$(shell echo -ne "PUT\n\n${contentType}\
View gist:463cc08705c61f92d2c9
// 1. Containing app - Store token url in the group user defaults.
DBAccount *account = [[DBAccountManager sharedManager] handleOpenURL:url];
if (account) {
NSUserDefaults *groupDefaults = [[NSUserDefaults alloc] initWithSuiteName:@"group.com.example.app"];
[groupDefaults setObject:url.absoluteString forKey:@"dropbox.token.url"];
[groupDefaults synchronize];
}
// 2. An Extension - Retrieve the token url from group user defaults, then give it to -[DBAccountManager handleOpenURL:] after setting "nonce".
NSUserDefaults *groupDefaults = [[NSUserDefaults alloc] initWithSuiteName:@"group.com.example.app"];
View Gemfile
source "https://rubygems.org"
gem "sinatra"
@hiroshi
hiroshi / Rakefile
Created Apr 11, 2013
heroku/ruby で bower install する hack ref: http://qiita.com/items/a8a01d6d69b99a9bb162
View Rakefile
task "assets:precompile" do
`(cd /tmp && curl -O https://heroku-buildpack-nodejs.s3.amazonaws.com/nodejs-0.8.19.tgz)`
`(mkdir -p bin/nodejs && cd bin/nodejs && tar xzf /tmp/nodejs-0.8.19.tgz)`
`(cd bin && ln -s nodejs/bin/node node)`
`node bin/nodejs/bin/npm install`
end
View .screenrc
escape ^Tt
#bind ^q quit
startup_message off
bell 'bell in window[%]'
hardstatus alwayslastline "[%Lw]%=%H %d%M(%D)%c"
defscrollback 100000
defencoding UTF-8
defutf8 on
@hiroshi
hiroshi / sh
Created Sep 21, 2012
.sha1 ファイルでなくハッシュ値だけあるときに verify する方法 ref: http://qiita.com/items/c2e9367dff315c86ce8a
View sh
$ echo "6393BA8BC2DD3CBD7B55D00B9D9587843BDB05CD Windows8-ReleasePreview-64bit-Japanese.iso" | shasum -c /dev/stdin
Windows8-ReleasePreview-64bit-Japanese-1.iso: OK
@hiroshi
hiroshi / file0.sql
Created Aug 30, 2012
ActiveRecord :binary type のカラムを psql でテキストに変換して見る ref: http://qiita.com/items/1f5a92b3537624ae897e
View file0.sql
SELECT encode(bin,'escape') FROM t;
You can’t perform that action at this time.