Skip to content

Instantly share code, notes, and snippets.

View Tsuguya's full-sized avatar
💭
I may be slow to respond.

Tsuguya Toma Tsuguya

💭
I may be slow to respond.
View GitHub Profile
@Tsuguya
Tsuguya / koa-qs.js
Created October 31, 2017 04:58
koaで無理矢理qsモジュールを使う
import qs from 'qs';
export default function(app) {
const request = app.request;
Object.defineProperty(request, 'query', {
get: function() {
const str = this.querystring;
const c = this._querycache = this._querycache || {};
return c[str] || (c[str] = qs.parse(str));
},
@Tsuguya
Tsuguya / document_root.php
Last active August 29, 2015 14:07
どうでもいいローカルでの環境構築作業を省略する ref: http://qiita.com/Tsuguya/items/c27de2dc31425e8ff50f
<?php
$_SERVER['DOCUMENT_ROOT'] = str_replace($_SERVER['SCRIPT_NAME'], '', $_SERVER['SCRIPT_F
ILENAME']);
if(isset($_SERVER['HTTP_PROXY_CONNECTION'])) {
unset($_SERVER['HTTP_PROXY_CONNECTION']);
}
if(isset($_SERVER['HTTP_CACHE_CONTROL'])) {
unset($_SERVER['HTTP_CACHE_CONTROL']);