func md5hash(text []byte) string {
h := md5.New()
h.Write(text)
return fmt.Sprintf("%x", h.Sum(nil))
}
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 heapq | |
import "errors" | |
type intMaxHeap struct { | |
buf []int | |
length int | |
} | |
func (h *intMaxHeap) Cap() int { |
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
// ==UserScript== | |
// @name AutoPagerizeSITEINFOLoader.js | |
// @author edvakf | |
// @namespace http://d.hatena.ne.jp/edvakf/ | |
// @description Help loading AutoPagerize SITEINFO | |
// @license The MIT License | |
// @version 0.2 | |
// @include * | |
// @released 2010-06-06 | |
// @updated 2010-06-06 |
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
// ==UserScript== | |
// @name iframe-addressbar | |
// @namespace http://d.hatena.ne.jp/edvakf/ | |
// @description Show pseudo address-bars for iframes on load and mouseover | |
// @include * | |
// ==/UserScript== | |
(function(win) { | |
if (win.top === win.self) return; |
This file has been truncated, but you can view the full file.
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
execve("/root/torch/install/bin/th", ["th", "waifu2x.lua", "--help"], [/* 14 vars */]) = 0 | |
brk(0) = 0x7fb106960000 | |
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory) | |
mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7fb105f57000 | |
access("/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or directory) | |
open("/root/torch/install/lib/tls/x86_64/libc.so.6", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory) | |
stat("/root/torch/install/lib/tls/x86_64", 0x7ffc979386c0) = -1 ENOENT (No such file or directory) | |
open("/root/torch/install/lib/tls/libc.so.6", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory) | |
stat("/root/torch/install/lib/tls", 0x7ffc979386c0) = -1 ENOENT (No such file or directory) |
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
// ==UserScript== | |
// @include http://www.youtube.com/* | |
// ==/UserScript== | |
(function() { | |
var clip = document.getElementsByClassName('clip'); | |
var timer; | |
function handleScroll() { |
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 sjisArrayToString(ary) { | |
var res = []; | |
for (var i = 0, code; code = ary[i++]; ) { | |
if (single_byte.hasOwnProperty(code)) { | |
res.push(single_byte[code]); | |
} else { | |
code = (code << 8) + ary[i++]; | |
if (double_byte.hasOwnProperty(code)) { | |
res.push(double_byte[code]); | |
} else { |
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
# /etc/nginx/nginx.conf | |
http { | |
# http://www.xmisao.com/2014/05/09/fluentd-elasticsearch-nginx-log.html | |
log_format ltsv 'time:$time_iso8601\t' | |
'remote_addr:$remote_addr\t' | |
'request_method:$request_method\t' | |
'request_length:$request_length\t' | |
'request_uri:$request_uri\t' | |
'https:$https\t' |
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
# sudo vi /etc/systemd/system/rack-test.service | |
[Unit] | |
Description=rack-test | |
After=syslog.target | |
[Service] | |
User=admin | |
Group=admin | |
WorkingDirectory=/home/admin/rack-test | |
Environment=PATH=/usr/local/bin:/usr/bin:/bin:/home/admin/local/bin |
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
$ mkdir rack-test | |
$ cd rack-test | |
$ vi Gemfile | |
$ vi config.ru | |
$ vi unicorn_config.rb | |
$ bundle install --path=.bundle | |
$ bundle exec unicorn -c ./unicorn_config.rb |