This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class A | |
using(Module.new do | |
refine A do | |
def private_hello | |
puts 'Hello, real private method!' | |
end | |
end | |
end) | |
def public_hello |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Requirements: ghq, hub | |
# Usage: ruby ghq_clone.rb YOUR_ACCOUNT_NAME | |
gem 'psych', '>= 3.0.1' | |
require 'octokit' | |
require 'psych' | |
require 'pathname' | |
def token | |
hub = Pathname(File.expand_path('~/.config/hub')) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
require 'pathname' | |
require 'optparse' | |
$LOAD_PATH.unshift(Pathname(__dir__).join('../lib/').realpath) | |
require 'rubocop' | |
pattern, ruby, version = ARGV.options do |opt| | |
version = RUBY_VERSION |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/imagemagick/trunk/PKGBUILD b/imagemagick/trunk/PKGBUILD | |
index 4c48742f627..38e36e4ac08 100644 | |
--- a/imagemagick/trunk/PKGBUILD | |
+++ b/imagemagick/trunk/PKGBUILD | |
@@ -1,9 +1,9 @@ | |
# $Id$ | |
# Maintainer: Eric Bélanger <[email protected]> | |
-pkgbase=imagemagick | |
-pkgname=('imagemagick' 'imagemagick-doc') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/autoload/iro/ruby.vim.rb b/autoload/iro/ruby.vim.rb | |
index 9bb1d7b..a638d01 100644 | |
--- a/autoload/iro/ruby.vim.rb | |
+++ b/autoload/iro/ruby.vim.rb | |
@@ -11,6 +11,9 @@ module IroVim | |
source = Vim.evaluate("getbufline(#{bufnr}, 1, '$')").join("\n") | |
result = Iro::Ruby::Parser.tokens(source) | |
Vim.command 'let s:result = ' + JSON.generate(result) | |
+ rescue => ex | |
+ puts ex.backtrace |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module PrivateBlock | |
def private(*args, &block) | |
return super unless block_given? | |
begin | |
methods = [] | |
mod = Module.new do | |
define_method :method_added do |name| | |
super(name).tap do | |
methods << name |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
status key command | |
Conversion Up ConvertPrev | |
Composition Tab PredictAndConvert | |
Conversion Tab PredictAndConvert | |
Composition Space Convert | |
Conversion Space ConvertNext | |
Precomposition Space InsertSpace | |
Conversion Shift Up ConvertPrevPage | |
Conversion Shift Tab ConvertPrev | |
Composition Shift Space Convert |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
static VALUE | |
str_upto_each(VALUE beg, VALUE end, int excl, int (*each)(VALUE, VALUE), VALUE arg) | |
{ | |
/* (snip) */ | |
/* normal case */ | |
n = rb_str_cmp(beg, end); | |
if (n > 0 || (excl && n == 0)) return beg; | |
after_end = rb_funcallv(end, succ, 0, 0); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def is_nil?(value) | |
result = true | |
value&.__id__(result = false) | |
result | |
rescue | |
result | |
end | |
TracePoint.new(:line) do |tp| | |
p tp |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def is_nil?(value, _=(value&.__id__(true&&return) rescue return)) | |
return true | |
end | |
p is_nil?(nil) | |
p is_nil?(false) | |
p is_nil?(true) | |
class A | |
undef __id__ |