Skip to content

Instantly share code, notes, and snippets.

/Users/onigra/sandbox/vendor/bundle/ruby/2.1.0/extensions/x86_64-darwin-13/2.1.0/nokogiri-1.6.1/nokogiri/nokogiri.bundle: [BUG] Segmentation fault at 0x00000000000438
ruby 2.1.2p95 (2014-05-08 revision 45877) [x86_64-darwin13.0]
-- Crash Report log information --------------------------------------------
See Crash Report log file under the one of following:
* ~/Library/Logs/CrashReporter
* /Library/Logs/CrashReporter
* ~/Library/Logs/DiagnosticReports
* /Library/Logs/DiagnosticReports
for more details.
@onigra
onigra / gist:67f1d1e758ca5a08cf6f
Last active April 29, 2016 10:24
markdown to redmine style
function! MarkdownToRedmine()
%s/######/h6./g
%s/#####/h5./g
%s/####/h4./g
%s/###/h3./g
%s/##/h2./g
%s/#/h1./g
%s/```\(.\+\)/<pre><code class=\"\1\">/g
%s/```/<\/pre>/g
endfunction
@onigra
onigra / man_ipconfig
Last active December 3, 2015 19:00
man ipconfig mac OSX
IPCONFIG(8) BSD System Manager's Manual IPCONFIG(8)
NAME
ipconfig -- view and control IP configuration state
SYNOPSIS
ipconfig waitall
ipconfig getifaddr interface-name
ipconfig ifcount
ipconfig getoption interface-name (option-name | option-code)
@onigra
onigra / man_ifconfig
Last active May 2, 2025 16:29
man ifconfig mac OSX
IFCONFIG(8) BSD System Manager's Manual IFCONFIG(8)
NAME
ifconfig -- configure network interface parameters
SYNOPSIS
ifconfig [-L] [-m] [-r] interface [create] [address_family] [address
[dest_address]] [parameters]
ifconfig interface destroy
ifconfig -a [-L] [-d] [-m] [-r] [-u] [-v] [address_family]
@onigra
onigra / gist:622922408477ea636781
Last active August 29, 2015 14:02
飲み物リクエスト

飲み物リクエスト

あるもの

  • 麦茶 * 2
  • 爽健美茶 * 1.5

買った

@onigra
onigra / bar.rb
Last active August 29, 2015 14:02
# 基底クラス
class Payment
def payment_class(payment_type)
"#{payment_type}Payment"
end
def pay(payment_type)
Object.const_get(payment_class payment_type).new.commit
end
end
Operator Load (5.2ms) SELECT "operators".* FROM "operators" WHERE "operators"."deleted_at" IS NULL
when_started hook failed: NoMethodError: private method `eval' called for nil:NilClass
/Users/yudai/develop/git-svn/2020.suzuki/vendor/bundle/ruby/2.1.0/gems/pry-stack_explorer-0.4.9.1/lib/pry-stack_explorer.rb:109:in `bindings_equal?'
(see _pry_.hooks.errors to debug)

Array#Indexes

arrayから引数に該当するindexの位置を取得してarrayで返す

require 'indexes'

[1, 2, 3, 1, 2].indexes 1

#=&gt; [0, 3]
@onigra
onigra / gist:1cad9b7364e4fac0f059
Created August 30, 2014 14:14
YAPC::Asia 2014 司会用カンペ

運営からのお知らせとお願いです。

1

ベストトーク賞は皆様の投票によってきまりますので、 投票をお願いいたします。

開催日ごとによかったトークを2つずつ投票できます。 昨日投票した人も今日投票することができます。

@onigra
onigra / rails_template.rb
Last active August 29, 2015 14:06
rails_template
return unless yes?('Use Template?')
gem 'slim-rails', github: 'slim-template/slim-rails'
gem "seed-fu"
gem 'active_model_serializers'
gem_group :development, :test do
gem 'awesome_print'
gem 'factory_girl_rails'
gem 'colorize_unpermitted_parameters'