Normalize unicode file names (converts UTF-8 NFD to NFC).
Required by macOS clients through AFP/NFS/SMB.
Tested on Synology DSM 6.2 with built-in Python 2.7.12.
#!/bin/sh | |
# Install | |
pkg install open-vm-tools xf86-input-vmmouse xf86-video-vmware xorg openbox obmenu | |
# Run services on start (see /etc/rc.conf) | |
sysrc dbus_enable="YES" | |
sysrc moused_enable="YES" | |
sysrc vmware_guest_vmblock_enable="YES" | |
sysrc vmware_guest_vmhgfs_enable="YES" |
RewriteEngine on | |
RewriteCond %{REQUEST_URI} !^/up.php | |
# TODO: Handle random port. | |
# TODO: Use ProxyPass or ProxyPassMatch instead of mod_proxy's RewriteRule for better performance. | |
RewriteRule ^(.*) http://127.0.0.1:8080/$1 [P] |
package main | |
import ( | |
"bufio" | |
"encoding/json" | |
"errors" | |
"fmt" | |
"log" | |
"net/http" | |
"net/url" |
var ( | |
testString = "xkjXS98XarHFzP1DQu03fJTLQQ7raCvoSKwlAjtTUgxZIbRt9OoAQyByESBXFYnxoHetPiZdfLHUDSh6ix1MQ2hUWKli2c79RPCjJd8weljUMh7XjIToFjU7W67gYDwMAtihxI5twI33hL6Bran4wclJcOGZVmlkASofpsPSWmsR3PS8p01rrVxcCvuSXuyIQa0JMrLI" | |
testStringsSlice = make([]struct{}, 1000) | |
) | |
// 69.4 ns/op | |
func BenchmarkForString(b *testing.B) { | |
for i := 0; i < b.N; i++ { | |
for j := 0; j < len(testString); j++ { | |
if testString[j] == '0' { |
func mergeSlices(s1, s2 []string) []string { | |
if s1 == nil { | |
return s2 | |
} else if s2 == nil { | |
return s1 | |
} | |
S1Loop: | |
for _, e1 := range s1 { | |
for _, e2 := range s2 { // Avoid duplicates. | |
if e1 == e2 { |
#GithubAPI Routes: 203 | |
GowwwRouter: 88024 Bytes | |
HttpRouter: 37464 Bytes | |
#GPlusAPI Routes: 13 | |
GowwwRouter: 6272 Bytes | |
HttpRouter: 2712 Bytes | |
#ParseAPI Routes: 26 | |
GowwwRouter: 10112 Bytes |