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
require 'stack'
class RPN
def initialize
@stack = Stack.new
end
def calc(expr)
expr.split.each do |e|
if %w[ + - * / ].include? e
" for .vimperatorrc
" 個人的に追加するコマンド達
javascript <<EOM
(function () {
[
['gmail', 'http://mail.google.com/', 'open Gmail'],
['gnews', 'http://news.google.co.jp/', 'open Google News'],
['gusnews', 'http://news.google.co.jp/news?ned=us', 'open Google News (U.S)'],
['gmap', 'http://maps.google.co.jp/', 'open Google Maps'],
['greader', 'http://www.google.com/reader/', 'open Google Reader'],
require 'test/unit'
require 'stack'
class TestStack < Test::Unit::TestCase
def setup
@stack = Stack.new
end
def test_empty?
assert(@stack.empty?)
class EmptyStackError < StandardError; end
class Stack
def initialize
@stack = []
@size = 0
end
def empty?
require 'mini/test'
Mini::Test.autorun
class StackOverflow < StandardError; end
class EmptyStackError < StandardError; end
class Stack
def initialize(max = 1.0/0.0)
@stack = []
require 'mini/spec'
Mini::Test.autorun
class EmptyStackError < StandardError; end
class Stack
def initialize
@stack = []
end
" vimperator plugin *MODOKI*
"
" USAGA:
" :gosh S式
(function() {
liberator.commands.addUserCommand(['gosh'], 'Evalute gauche code',
function(arg, special) {
// Set your gosh path!
// 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