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
# make zopfli | |
pushd . | |
git clone https://github.com/google/zopfli.git zopfli-build && cd zopfli-build && make | |
export PATH="$PATH:$(pwd)" | |
popd | |
# after assets precompile, zopfli all of them [nproc/sysctl -n hw.ncpu for compat btw centos & macox] | |
find public/assets | grep -E '.*\.(css|js)$' | xargs -P $(if [ $(which nproc) ]; then nproc; else sysctl -n hw.ncpu; fi;) zopfli |
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
EventMachine::HttpRequest.use EventMachine::Middleware::JSONResponse | |
# prepare request | |
con = EventMachine::HttpRequest.new('https://stream.twitter.com/1.1/statuses/filter.json', { | |
connect_timeout: 0, | |
inactivity_timeout: 0, | |
keepalive: true | |
}) | |
# plug oauth | |
con.use EventMachine::Middleware::OAuth({...keys..}) | |
# setup tracking |
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
# frozen_string_literal: true | |
require "fiber" | |
module ActionView | |
# == TODO | |
# | |
# * Support streaming from child templates, partials and so on. | |
# * Rack::Cache needs to support streaming bodies | |
class StreamingTemplateRenderer < TemplateRenderer #:nodoc: | |
# Ruby fibers does not support Thread.current[:locals] |
OlderNewer