Skip to content

Instantly share code, notes, and snippets.

View Sixeight's full-sized avatar
🏠
Working from home

Tomohiro Nishimura Sixeight

🏠
Working from home
View GitHub Profile
// listgmail.js
// View new mail list on Gmail.
// tomohiro nishimura ( tomohiro68__at__gmail.con )
//
// 参考: http://svn.coderepos.org/share/lang/javascript/vimperator-plugins/trunk/gmail_biff.js
liberator.plugins.sbmCommentsViewer = (function(){
liberator.commands.addUserCommand(['newmail', 'gnew'], 'List up new mail on gmail',
function(argument, special){
setTimeout(function(){
# よくわからない習作
me = Object.new
class << me
def get_bind
binding
end
def method_missing(name, *arg)
require 'rubygems'
require 'RMagick'
1.upto 50 do |idx|
file = Dir["#{idx}/*.*"].first
p file
if file
img = Magick::ImageList.new(file).first
img.change_geometry('600x600') do |c, l, i|
i.resize! c, l
@Sixeight
Sixeight / gist:29957
Created November 28, 2008 10:01 — forked from ukstudio/gist:29937
# クラスオブジェクトを取得
module Foo
class Bar
def class_object
self.class.to_s.split(/::/).inject(Object) do |c, name|
c.const_get(name)
end
end
end
end
#! /usr/bin/env ruby
require 'optparse'
require 'readline'
require 'yaml'
defname = 'lonst_session.yml'
Readline.vi_editing_mode
OptionParser.new do |opt|
require 'forwardable'
# A singleton class inspired by Primer class in library
class Class
# We need that method like this become a bultin
def metaclass; class << self; self end end
end
class Foo
# Class#meta..class
class Class
def method_missing(meth, *args)
unless meth.to_s =~ /\A((?:meta)+)class\z/
super
end
level = $1.gsub(/meta/).count
level.times.inject(self) {|klass, _| class << klass; self end }
end
# This is a test/unit clone which was written to practice.
#
# Usage:
#
# require 'simpletest'
#
# class Foo < SimpleTest::TestCase
#
# def test_bar
# assert_equal 1, 1
module Config
class Storage
def initialize(name, value = nil, parent = nil)
@_name = (parent ? "#{parent}." : '') + name
@_value = value
end
def method_missing(sym, *args)
#! /usr/bin/env ruby
# -*- conding: utf-8 -*-
require 'nkf'
unless ARGV.size == 1
warn 'pleese set directory'
exit
end