Skip to content

Instantly share code, notes, and snippets.

View yaotti's full-sized avatar

Hiroshige Umino yaotti

View GitHub Profile
@yaotti
yaotti / Bluepaper-ja.md
Last active August 7, 2018 13:42
Steem Bluepaper ja

header-includes: - \usepackage[usenames, dvipsnames]{color} - \usepackage{xcolor} - \usepackage{fancyhdr} - \definecolor{mygray}{gray}{0.3} - \definecolor{myblue}{HTML}{CFE2F3} - \usepackage[top=3cm,bottom=4cm,left=4cm,right=4cm,headheight=20pt,headsep=30pt,footnotesep=1.5\baselineskip]{geometry}

  • \usepackage{graphicx}
@yaotti
yaotti / ruboty-startup_quote.gemspec
Last active August 29, 2015 14:17
ruboty-startup_quote
Gem::Specification.new do |spec|
spec.name = "ruboty-startup_quote"
spec.version = "0.0.1"
spec.authors = ["Hiroshige Umino"]
spec.email = ["hiroshige88@gmail.com"]
spec.summary = "A ruboty handler for Startup Quote"
spec.homepage = "https://github.com/yaotti"
spec.license = "MIT"
spec.files = ["ruboty-startup_quote.rb"]
@yaotti
yaotti / named-params.rb
Created February 7, 2014 06:34
Ruby's named params and a hash with string keys
def foo(arg: 1)
puts "arg: #{arg}"
end
foo({ arg: 10 })
#=> arg: 10
foo({ 'arg' => 10 })
#=> /Users/yaotti/sandbox/named-params.rb:1:in `foo': wrong number of arguments (1 for 0) (ArgumentError)
# from /Users/yaotti/sandbox/named-params.rb:6:in `<main>'
@yaotti
yaotti / file0.txt
Created December 4, 2013 14:30
ある程度Gitを操作できるようになってから当たると良いマニュアル/情報源 ref: http://qiita.com/yaotti/items/5b70c9f9d882f6f10023
$ git help -g
The common Git guides are:
attributes Defining attributes per path
glossary A Git glossary
ignore Specifies intentionally untracked files to ignore
modules Defining submodule properties
revisions Specifying revisions and ranges for Git
tutorial A tutorial introduction to Git (for version 1.5.1 or newer)
workflows An overview of recommended workflows with Git
@yaotti
yaotti / file0.txt
Created December 4, 2013 10:46
Rails 4.0.1以降へのアップデート後に`ARModel.create`が`NoMethodError: undefined method '[]' for nil:NilClass`というエラーを吐く ref: http://qiita.com/yaotti/items/73305e3719c309f8d0d6
[1] pry(main)> User.create
NoMethodError: undefined method `[]' for nil:NilClass
from /opt/boxen/rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/gems/activerecord-4.0.2/lib/active_record/attribute_methods/read.rb:86:in `block in read_attribute'
@yaotti
yaotti / file0.txt
Created December 1, 2013 14:17
Railsのコンソールをより便利にするpry-rails gem ref: http://qiita.com/yaotti/items/c6e850010f36acedb0e1
[1] pry(main)> show-middleware
use Raven::Rack
use ActionDispatch::Static
use Rack::Lock
use ActiveSupport::Cache::Strategy::LocalCache
...
@yaotti
yaotti / a.rb
Created August 16, 2013 16:38
These code cause SEGV in ruby 2.1.0-dev but the bug is already fixed in ruby-head (I tested it in ff377d9e81e9c0e58ba1034b1b58cfb68d63c301).
#!/usr/bin/env ruby
def let(name, &block)
::BasicObject.send(:define_method, name, &block)
define_method(name) do
super(&nil)
end
end
let(:foo) { foo }
foo
set nocompatible " おまじない
syntax on " シンタックスハイライト有効化
set number " 行数表示
nnoremap q :<C-u>q<CR> " q でvimを閉じる
colorscheme darkblue
" 行末のスペースを赤く表示する
highlight WhitespaceEOL ctermbg=red
match WhitespaceEOL /\s\+$/
@yaotti
yaotti / .tigrc
Created June 21, 2013 06:38
tigで見ているコミットのページをgithubで開く ref: http://qiita.com/yaotti/items/62947b0c981ae38fae82
bind main G !@hub browse -- commit/%(commit)
bind diff G !@hub browse -- commit/%(commit)
@yaotti
yaotti / circle.yml
Created February 21, 2013 01:00
a workaround to show correct status in Circle CI
machine:
ruby:
version:
1.9.3-p385
test:
override:
- output=$(bundle exec spring rspec --format=p spec); echo $output; echo $output | grep '0 failure'