Skip to content

Instantly share code, notes, and snippets.

卜部昌平 shyouhei

Block or report user

Report or block shyouhei

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
@shyouhei
shyouhei / gist:77259
Created Mar 11, 2009
ruby 1.8.6's rubyspec result over 9fcd252b92f5b2130db17a924e7338f2a9773ec1 at master
View gist:77259
zsh % ~/target/branches/ruby_1_8_6/bin/ruby /home/shyouhei/ruby/branches/ruby_1_8/rubyspec/mspec/bin/mspec-run --background --prefix /home/shyouhei/ruby/branches/ruby_1_8/rubyspec/spec -B /home/shyouhei/ruby/branches/ruby_1_8/rubyspec/spec/ruby.1.8.mspec
.........................................F.......................................................................................................F..........................................................................................................................................................................................E.......................................E.........................................E.................................................................................................................................................................................................................................................................................................................................................................
View gist:606432
# Copyright(c) 2010 Urabe, Shyouhei. All rights Reserved.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this code, to deal in the code without restriction, including without
# limitation the rights to use, copy, modify, merge, publish, distribute,
# sublicense, and/or sell copies of the code, and to permit persons to whom the
# code is furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be
# included in all copies or substantial portions of the code.
View commitrank.rb
#! /usr/bin/ruby
require 'svn/client'
require 'tempfile'
# (1) get the data
file = 'tmp.marshal'
dat = nil
begin
open file, 'rb' do |fp|
dat = Marshal.load fp
@shyouhei
shyouhei / bug.rb
Created Nov 1, 2011
Pathname's raising "invalid sequence"
View bug.rb
# -*- coding: utf-8 -*-
require 'pathname'
s1 = File.dirname(__FILE__)
s2 = File.expand_path('ディレクトリ/ファイル', s1)
s3 = File.dirname(s2)
s4 = File.expand_path(s3)
p1 = Pathname(s2)
p2 = Pathname(s4)
p3 = p2.relative_path_from(p1)
@shyouhei
shyouhei / gist:1445972
Created Dec 8, 2011
Coverage kills encodings
View gist:1445972
zsh % ruby -ve '
require "fileutils"
require "coverage"
FileUtils.mkdir_p "ディレクトリ"
FileUtils.touch "ディレクトリ/ファイル.rb"
$LOAD_PATH << "ディレクトリ"
Coverage.start
require "ファイル"
View gist:1471818
#! /bin/ruby1.8.7 -Ku
require 'socket'
require 'open-uri'
require 'time'
require 'json'
require 'base64'
def cut str, len=100
a = str.scan /./u
View gist:2405349
View ruby 1.8.7 (2012-04-14 patchlevel 361) [x86_64-linux]
require 'benchmark'
a = Array.new(4096) { [rand(1 << 64), rand(1 << 64)] }
n = 1 << 32
Benchmark.bmbm do |x|
x.report do
a.collect do |b|
a.select do |c|
n >= Math.sqrt(
(b[0] - c[0]) ** 2 + (b[1] - c[1]) ** 2
)
View gist:2773436
diff --git a/tengine_resource/tengine_resource.gemspec b/tengine_resource/tengine_resource.gemspec
index 7730e17..fb205d1 100644
--- a/tengine_resource/tengine_resource.gemspec
+++ b/tengine_resource/tengine_resource.gemspec
@@ -9,7 +9,7 @@ Gem::Specification.new do |s|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
s.authors = ["taigou", "totty", "g-morita", "shyouhei", "akm", "hiroshinakao"]
- s.date = "2012-05-02"
+ s.date = "2012-05-23"
You can’t perform that action at this time.