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
package main | |
import ( | |
"encoding/json" | |
"log" | |
"net/http" | |
"reflect" | |
"time" | |
"github.com/gorilla/context" |
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
;(function($){ | |
var touch = {}, | |
touchTimeout, tapTimeout, swipeTimeout, | |
longTapDelay = 750, longTapTimeout | |
function parentIfText(node) { | |
return 'tagName' in node ? node : node.parentNode | |
} | |
function swipeDirection(x1, x2, y1, y2) { |
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
http { | |
proxy_cache_path /var/cache/nginx levels=1:2 keys_zone=one:8m max_size=3000m inactive=600m; | |
proxy_temp_path /var/tmp; | |
include mime.types; | |
default_type application/octet-stream; | |
sendfile on; | |
keepalive_timeout 65; | |
gzip on; | |
gzip_comp_level 6; |
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
var validator = require('validator'); | |
var hankaku = '1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ '; | |
var zenkaku = '1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ '; | |
var zenkakuToHankaku = function (word) { | |
for (var i = 0, n = zenkaku.length; i < n; i++) { | |
word = word.replace(new RegExp(zenkaku[i], 'gm'), hankaku[i]); | |
} | |
return word.replace(/^\s+|\s+$/g, ''); // trim head and tail white space | |
}; |