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
# -*- coding: utf-8 -*- | |
require 'cgi' | |
require 'rexml/document' | |
require 'open-uri' | |
class Suggest | |
attr_reader :response | |
def initialize | |
@query_base = "http://www.google.co.jp/complete/search?output=toolbar&hl=ja&q=%s" |
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
# coding: utf-8 | |
require 'test/unit' | |
require File.join(File.dirname(File.expand_path(__FILE__)), '..', 'lib', 'zenra') | |
class ZenraTest < Test::Unit::TestCase | |
def setup | |
@appid = ENV['YAHOO_APPID'] | |
end |
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
require 'formula' | |
<<-COMMENTS | |
This is the Homebrew formula for Python. | |
Versions | |
-------- | |
This formula is currently tracking version 2.6.x. |
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
require 'formula' | |
class Emacs <Formula | |
url 'http://ftp.gnu.org/pub/gnu/emacs/emacs-23.2.tar.bz2' | |
md5 '057a0379f2f6b85fb114d8c723c79ce2' | |
homepage 'http://www.gnu.org/software/emacs/' | |
if ARGV.include? "--use-git-head" | |
head 'git://repo.or.cz/emacs.git' | |
else |
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
require 'formula' | |
class Emacs < Formula | |
url 'http://ftp.gnu.org/pub/gnu/emacs/emacs-23.3a.tar.bz2' | |
md5 'f2cf8dc6f28f8ae59bc695b4ddda339c' | |
homepage 'http://www.gnu.org/software/emacs/' | |
skip_clean :all | |
if ARGV.include? "--use-git-head" |
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 | |
# -*- coding: utf-8 -*- | |
file_name = ARGV[0] | |
if !file_name || !File.exists?(file_name) | |
puts "file not found." | |
exit | |
end | |
File.open(file_name) { |f| |
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
r = Array.new(12).fill(0) ; while (r.include?(0)) do r[rand(r.count)] += 1 ; end ; puts "#{r.count}個のガチャをコンプするために #{r.inject(:+)}回抽選しました。" |
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
# -*- coding: utf-8 -*- | |
require 'rspec' | |
class String | |
def mb_width | |
self.split('').inject(0) { |r, c| c =~ /^[ -~。-゚]*$/ ? r += 1 : r += 2 ; r } | |
end | |
end | |
describe String do |
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
# https://github.com/guard/guard-rspec | |
guard 'rspec', :version => 2, :all_after_pass => false, :all_on_start => false, :cli => '--color --format nested --fail-fast --drb' do | |
watch(%r{^spec/.+_spec\.rb$}) | |
watch(%r{^lib/(.+)\.rb$}) { |m| "spec/lib/#{m[1]}_spec.rb" } | |
watch('spec/spec_helper.rb') { "spec" } | |
end | |
# https://github.com/guard/guard-spork | |
guard 'spork', :rspec_env => { 'PADRINO_ENV' => 'test' } do | |
watch('Gemfile') |
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
;;; dark-laptop-theme.el --- dark-laptop | |
(deftheme dark-laptop | |
"dark-laptop") | |
(custom-theme-set-faces 'dark-laptop | |
'(default ((t (:stipple nil :background "black" :foreground "white" :inverse-video nil :box nil :strike-through nil :overline nil :underline nil :slant normal :weight normal :height 120 :width normal :foundry "apple" :family "Monaco")))) | |
'(bold ((t (:weight bold)))) | |
'(italic ((t (:slant italic)))) | |
'(bold-italic ((t (:slant italic :weight bold)))) |
OlderNewer