Skip to content

Instantly share code, notes, and snippets.

View noisan's full-sized avatar

Akihiro Yamanoi noisan

View GitHub Profile
@noisan
noisan / css.html
Created October 2, 2015 07:27
Async CSS loader snippet inspired by https://github.com/filamentgroup/loadCSS/
<!doctype html>
<html>
<head>
<meta charset="UTF-8">
<title>loadCSS test</title>
<script>
(function(w, href) {
"use strict";
var d = w.document;
var ss = d.createElement('link');
@noisan
noisan / flush.php
Created September 9, 2014 10:28
flush() test for mod_proxy_fcgi.c.patch
<html>
<body>
=== START ===<br />
<?php
for ($i = 0; $i < 5; $i++) {
echo date('Y-m-d H:i:s'), '<br />';
flush();
sleep(1);
@noisan
noisan / mod_proxy_fcgi.c.patch
Last active May 22, 2017 19:17
Quick patch for mod_proxy_fcgi to work with `flush()` (Apache httpd-2.4.10)
--- modules/proxy/mod_proxy_fcgi.c.orig 2014-06-26 09:24:44.000000000 +0900
+++ modules/proxy/mod_proxy_fcgi.c 2014-09-09 18:19:28.102859189 +0900
@@ -690,6 +690,21 @@
break;
}
}
+
+ if (type == AP_FCGI_STDOUT) {
+ APR_BRIGADE_INSERT_TAIL(ob, apr_bucket_flush_create(c->bucket_alloc));
+