Yahoo! Pipes 代替を OSS で作りたい、というプロジェクト。
- あらゆる関数をパイプラインのように繋ぎ合わせて、入力を変換して最終的な出力を生成する
- 入力は様々なものを選択できる
- フォーム入力
- Web ページ
API 使ってやろう、とも思ったけど OAuth 認証がやたらめんどくさそうだったので断念... 登録した写真はログイン後のトップページに全て収まる程度の量だったので、その URL (http://f.hatena.ne.jp/*/) を開いた状態で、Chrome のコンソールに
Array.prototype.map.apply(document.querySelectorAll('.foto_thumb'), [function (e) { return e.src.replace('_120', ''); }])
と入力。 これで URL の一覧を JSON っぽい文字列で取得できる。
time:06/Nov/2014:06:40:50 +0900 msec:1415223650.179 forwardedfor:- req:GET /page/16 HTTP/1.1 method:GET uri:/page/16 protocol:HTTP/1.1 status:200 size:17311 referer:- ua:Mozilla/5.0 (iPhone; CPU iPhone OS 6_0 like Mac OS X) AppleWebKit/536.26 (KHTML, like Gecko) Version/6.0 Mobile/10A5376e Safari/8536.25 (compatible; Googlebot/2.1; +http://www.google.com/bot.html) reqtime:0.365 cache:- runtime:- vhost:blog.yuyat.jp | |
time:06/Nov/2014:06:42:36 +0900 msec:1415223756.217 forwardedfor:- req:GET /archives/date/2010/04 HTTP/1.1 method:GET uri:/archives/date/2010/04 protocol:HTTP/1.1 status:200 size:8414 referer:- ua:Mozilla/5.0 (compatible; bingbot/2.0; +http://www.bing.com/bingbot.htm) reqtime:0.324 cache:- runtime:- vhost:blog.yuyat.jp | |
time:06/Nov/2014:06:44:36 +0900 msec:1415223876.141 forwardedfor:- req:GET /archives/2177/3bb79df7183f72b5ceceb573851ee30f HTTP/1.1 method:GET uri:/archives/2177/3bb79df7183f72b5ceceb573851ee30f protocol:HTTP/1.1 status:200 size:8336 referer:- ua:Mozilla/5.0 (compatible; Baiduspider/ |
#!/bin/sh | |
selected_function=$(php -r '$fs=get_defined_functions();echo join(PHP_EOL, $fs["internal"]), PHP_EOL;' | sort | peco) | |
if [ -n "$selected_function" ]; then | |
php --rf "$selected_function" | |
exit 0 | |
else | |
echo "No function is selected" | |
exit 1 | |
fi |
ruby -ane 'puts "Testing at #{$F[1]}...";puts `dig @#{$F[1]} +short porttest.dns-oarc.net TXT`;puts' /etc/resolv.conf |
in PHP (composer require woothee/woothee:*)
<?php
include __DIR__ . '/vendor/autoload.php';
$classifier = \Woothee\Classifier;
$classifier->parse('Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; Trident/4.0)');
// => ['name' => 'Internet Explorer', 'category' => 'pc', 'os' => 'Windows 7', 'version' => '8.0', 'vendor' => 'Microsoft']
# 集中したいときに実行するやつ | |
BASEDIR = 'C:\WINDOWS\system32\drivers\etc' | |
open File.join(BASEDIR, 'hosts'), 'w' do |hosts| | |
hosts.puts(open(File.join(BASEDIR, 'hosts.template')).read) | |
hosts.puts(open(File.join(BASEDIR, 'hosts.template_to_focus')).read) | |
end |
#!/usr/bin/env ruby | |
# 引数に指定した IP を逆引きして、その結果をさらに正引きするヤツ | |
# https://gist.github.com/yuya-takeyama/8911897 | |
# Author: Yuya Takeyama | |
unless ARGV[0] | |
puts "Usage: " | |
puts '$ ' + File.basename(__FILE__) + " HOST" | |
exit 255 | |
end |