Skip to content

Instantly share code, notes, and snippets.

Kensuke Nagae kyanny

Block or report user

Report or block kyanny

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
kyanny / user.css
Created Jan 26, 2018
View user.css
@-moz-document url-prefix(""), url-prefix(""), regexp("*/notifications.*") {
.list-group-item.navigation-focus {
outline: 1px black dashed;
View faraday_proxy.rb
#!/usr/bin/env ruby
require 'faraday'
require 'logger'
url = ''
proxy = ENV.fetch('PROXY')
logger =$stdout)
conn = do |faraday|
faraday.response :logger, logger
View index.html
<!DOCTYPE html>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
<script id="jsbin-javascript">
kyanny / bad.rb
Last active Aug 24, 2017
NameError: uninitialized constant ActiveModel::Serializers::Xml in MongoMapper
View bad.rb
require 'active_model'
require 'mongo_mapper'
MongoMapper.database = 'testing'
class Foo
include MongoMapper::Document
kyanny / x2str.rb
Created Aug 12, 2017
\xXX 形式の文字列を UTF-8 とみなしてデコードする
View x2str.rb
#!/usr/bin/env ruby
def x2str(x)
# assume x is hex format of UTF-8 string, so that process 3 bytes at once
x.gsub(/\\x(..)\\x(..)\\x(..)/) {
x = ARGV[0]
kyanny / str2x.rb
Created Aug 12, 2017
文字列を \xXX 形式に変換する
View str2x.rb
#!/usr/bin/env ruby
def str2x(str)
str.unpack("H*").first.scan(/[0-9a-z]{2}/).map{ |x| '\x' + x.upcase }.join
str = ARGV[0]
unless str
puts <<USAGE
Usage: ruby #{$0} STRING
You can’t perform that action at this time.