いかにしておっぱい画像をダウンロードするか〜2012 - ゆーすけべー日記
これを Ruby でそのまま実装してみた
git clone git://gist.github.com/1937292.git oppai # この Gist をコピー
cd oppai
bundle install # Bundler で依存ライブラリをインストール
いかにしておっぱい画像をダウンロードするか〜2012 - ゆーすけべー日記
これを Ruby でそのまま実装してみた
git clone git://gist.github.com/1937292.git oppai # この Gist をコピー
cd oppai
bundle install # Bundler で依存ライブラリをインストール
| diff -Naru 1.0_0/script.js 1.0_0p/script.js | |
| --- 1.0_0/script.js 2012-01-16 13:42:39.771423716 +0900 | |
| +++ 1.0_0p/script.js 2012-01-16 13:47:48.915422946 +0900 | |
| @@ -12,6 +12,14 @@ | |
| (function(w, content_window, d) { 'use strict'; | |
| +var channels = (function(objs) { | |
| + var names = []; | |
| + for (var i = 1; i < objs.length; ++i) { |
| # Chromeの最新Dev版にLiveReloadをインストール | |
| # Chromeの拡張機能管理画面でLiveReloadの「ファイルの URL へのアクセスを許可する」にチェックを入れておく | |
| # ターミナルでguard関係のセットアップ | |
| $ gem install rb-fsevent | |
| $ gem install em-websocket | |
| $ gem install guard | |
| $ gem install guard-livereload | |
| $ gem install guard-sass |
| #!/usr/bin/perl | |
| use strict; | |
| use warnings; | |
| use Config::Pit; | |
| use URI; | |
| use URI::QueryParam; | |
| use URI::Escape; | |
| use LWP::UserAgent; |
| require 'rake' | |
| require 'css_splitter' | |
| desc 'split css files' | |
| namespace :css do | |
| task :split do | |
| infile = ENV['infile'] || raise("missing infile") | |
| outdir = ENV['outdir'] || File.dirname(infile) | |
| max_selectors = ENV['max_selectors'] || 4095 |
| (function addXhrProgressEvent($) { | |
| var originalXhr = $.ajaxSettings.xhr; | |
| $.ajaxSetup({ | |
| progress: function() { console.log("standard progress callback"); }, | |
| xhr: function() { | |
| var req = originalXhr(), that = this; | |
| if (req) { | |
| if (typeof req.addEventListener == "function") { | |
| req.addEventListener("progress", function(evt) { | |
| that.progress(evt); |
| (function(w,l){ | |
| //return; | |
| var excludes = ['google.com'].join('|'); | |
| var trusted = ['dragonfly.opera.com','bit.ly','delicious.com','www.google.co.jp','gyazo.com','delicious.com','google.com','lingr.com','www.w3.org','ashula.info','fastladder.com','www.opera.com','opera-users.jp','puchi.co','oflo.in','ofton.in','opera-wiki.com','localhost','browser-festa.jp' | |
| ].join('|'); | |
| if ( !l.protocol.match(/http/) | |
| || ( w.parent !== w ) | |
| || ( l.hostname.match(new RegExp('(' + excludes + ')$' ))) | |
| || ( l.hostname.match(new RegExp('(' + trusted + ')$' ))) | |
| ){ |
| use strict; | |
| use Data::Section::Simple; | |
| use Encode; | |
| use JSON; | |
| use Path::Class; | |
| use Plack::Builder; | |
| use Plack::Request; | |
| use Text::Markdown; | |
| use Text::Xslate; |
| var dispatcher = { | |
| location: window.location, | |
| stash : [], | |
| connect: function(paths, action) { | |
| if (paths || paths === 0) { | |
| paths = paths.valueOf(); | |
| if (!(typeof paths == 'object' && !(paths instanceof RegExp))) // webkit: typeof RegExp == 'function' | |
| paths = { pathname: paths }; | |
| dispatcher.stash.push([paths, action]); |