a
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 'mechanize' | |
require 'json' | |
result = [] | |
top_url = 'http://stationmemories.wiki.fc2.com/' | |
wiki = Mechanize.new.get(top_url) | |
wiki.search('ul.treemenu_ul')[0].css('li a').each do|denko| | |
# でんこ個別ページ取得 | |
page = Mechanize.new.get(top_url + denko[:href]) | |
# でんこの名前取得 | |
name = page.search('.page_title h1').text |
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
{ | |
"name": "yamanote-tintai", | |
"version": "1.0.0", | |
"description": "", | |
"main": "index.js", | |
"scripts": { | |
"test": "echo \"Error: no test specified\" && exit 1" | |
}, | |
"author": "", | |
"license": "ISC", |
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
upstream php-handler { | |
# server 127.0.0.1:9000; | |
server unix:/var/run/php5-fpm.sock; | |
} | |
server { | |
listen 80; | |
server_name _; | |
# ssl_certificate /etc/ssl/nginx/cloud.example.com.crt; | |
# ssl_certificate_key /etc/ssl/nginx/cloud.example.com.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
require 'benchmark' | |
namespace :bulk do | |
desc "TODO" | |
task insert: :environment do | |
Task.delete_all | |
Benchmark.bm 100 do |r| | |
r.report "normal" do | |
1000.times do |i| | |
Task.create(title: "#{i}", content: "content #{i}") | |
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
# A sample Gemfile | |
source "https://rubygems.org" | |
# gem "rails" | |
gem 'slack-ruby-bot' | |
gem 'natto' | |
gem 'activerecord' | |
gem 'sqlite3' |
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 'slack-ruby-bot' | |
class SlotBot < SlackRubyBot::Bot | |
match /slot/ do |client, data, match| | |
array = %w(:ulicknormanowen: :shausagi: :fire: :sushi:) | |
result = [] | |
3.times do | |
result << array.sample | |
end | |
msg = "Start! =>" | |
msg << result.join(" ") |
Gemfile に以下を追加
gem 'compass'
ひな壇を生成
bundle exec compass create
wheneverize .
http://qiita.com/koshigoe/items/243d4cb81e6bb7aba0c7
set :output, 'log/crontab.log'
set :environment, :development
every 1.minutes do
OlderNewer