This file contains hidden or 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 perl | |
use strict; | |
use warnings; | |
use utf8; | |
use Mojolicious::Lite; | |
use Encode; | |
use EV; | |
use AnyEvent::Twitter::Stream; |
This file contains hidden or 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
use strict; | |
use warnings; | |
use utf8; | |
use AnyEvent::Twitter::Stream; | |
use Log::Minimal; | |
$Log::Minimal::AUTODUMP=1; | |
$Log::Minimal::COLOR=1; |
This file contains hidden or 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
<!DOCTYPE html> | |
<html lang="ja"> | |
<head> | |
<meta charset="utf-8"/> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=yes"/> | |
<meta name="format-detection" content="telephone=no"/> | |
<meta name="apple-mobile-web-app-capable" content="yes"/> | |
<link media="screen" rel="stylesheet" href="http://code.jquery.com/mobile/1.0/jquery.mobile-1.0.min.css"/> | |
<link rel="apple-touch-icon" href="apple-touch-icon.png"/> | |
<script src="http://code.jquery.com/jquery.min.js"></script> |
This file contains hidden or 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
sub test1 { | |
# reference | |
return [0, "error"]; | |
} | |
sub test2 { | |
# array | |
return (0, "success"); | |
} |
This file contains hidden or 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
// | |
// plugin呼び出し | |
// | |
$(function() { | |
$.sample2.hello("world"); | |
}); | |
// | |
// plugin本体 | |
// |
This file contains hidden or 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
// | |
// plugin呼び出し | |
// | |
$(function() { | |
$("#message").sample1("hello world").css("color","red"); | |
}); | |
// | |
// plugin本体 | |
// |
This file contains hidden or 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
// | |
// プラグイン呼び出し | |
// | |
$(function() { | |
$.sample({debug:true}); | |
}); | |
// | |
// プラグイン本体 |
This file contains hidden or 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
module Hoge | |
def hello | |
puts "hello" | |
end | |
end | |
class Test | |
end |
This file contains hidden or 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; -*- | |
# | |
# scraping nikkei.com for Kindle | |
# | |
require 'nokogiri' | |
require 'open-uri' | |
TOP = 'http://www.nikkei.com' |
This file contains hidden or 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 'rubygems' | |
require 'open-uri' | |
require 'nokogiri' | |
KCODE = 'euc-jp' | |
index_url = 'http://www.dmm.co.jp/digital/videoa/-/actress/=/keyword=%s/' | |
%w(a ka sa ta na ha ma ya ra wa).each do |w| | |
content = Nokogiri::HTML.parse(open(index_url % w).read) |