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 'mechanize' | |
require 'pit' | |
require 'uri' | |
pit = Pit.get('hatena', :require => { | |
'username' => 'username', | |
'password' => 'password'}) | |
BASE = URI("http://graph.hatena.ne.jp/#{pit['username']}/") |
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 default_value | |
p 'generate default_value' | |
'default value' | |
end | |
def some_method(param = nil) | |
param ||= default_value | |
p param | |
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
def default_value | |
p 'generate default_value' | |
'default value' | |
end | |
def some_method(param = nil) | |
param ||= default_value | |
p param | |
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
#!/usr/bin/env ruby | |
require 'pit' | |
require 'mechanize' | |
require 'uri' | |
pit = Pit.get('github', :require => { | |
'username' => 'username', | |
'password' => 'password'}) | |
BASE = URI('http://gist.github.com/') |
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' | |
if ARGV.length < 1 | |
p 'please input dir name' | |
else | |
@dir = Pathname.new(ARGV.shift).expand_path | |
@join_name = ARGV.join('_') | |
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
html { | |
margin: 0; | |
padding: 0; | |
} | |
body{ | |
color: #f0f0f0; | |
background-color: #303030; | |
font-size: 80%; | |
font-family: Verdana, "Lucida Grande", "Hiragino Kaku Gothic Pro", "ヒラギノ角ゴ Pro W3", "MS Pゴシック", sans-serif; |
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
body { | |
font-family: "Hiragino Kaku Gothic Pro", "Arial", sans-serif; | |
margin: 0 8%; | |
font-size: 14px; | |
} | |
h1 { | |
font-size: 50px; | |
} |
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 -*- | |
require 'pit' | |
require 'mechanize' | |
require 'ruby-growl' | |
require 'cgi' | |
$KCODE ='u' | |
conf = Pit.get('outputz.com', :require => { 'key' => 'please input your secret key!'}) |
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 | |
timing = [1, 7, 14, 30] | |
now = Time.now | |
result = timing.inject(now) do |res, t| | |
p res.strftime("%Y/%m/%d") | |
res + t * 24 * 60 * 60 | |
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 'nokogiri' | |
require 'net/http' | |
$KCODE = 'u' | |
def lou(text) | |
req = Net::HTTP::Post.new('/?') | |
Net::HTTP.version_1_2 | |
Net::HTTP.start('lou5.jp') do |http| | |
res = http.request(req, "text=#{text}") | |
doc = Nokogiri::HTML.parse(res.body, nil, 'utf-8') |
OlderNewer