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
'use strict'; | |
// LastModifiedの変化を検知してimgをロードする | |
let $ = require('jquery'); | |
module.exports = (imgSrc, callback) => { | |
let beforeLastModified; | |
let downloadImg = () => { | |
$.get(imgSrc, (data, status, xhr) => { |
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
< ab -n 1000 -c 10 'http://127.0.0.1:8080/' [~/local/go/1.7-rc1] | |
This is ApacheBench, Version 2.3 <$Revision: 1706008 $> | |
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/ | |
Licensed to The Apache Software Foundation, http://www.apache.org/ | |
Benchmarking 127.0.0.1 (be patient) | |
Completed 100 requests | |
Completed 200 requests | |
Completed 300 requests | |
Completed 400 requests |
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
diff --git a/bin/varnishtest/vtc_http2.c b/bin/varnishtest/vtc_http2.c | |
index ea29f2e..ff971f3 100644 | |
--- a/bin/varnishtest/vtc_http2.c | |
+++ b/bin/varnishtest/vtc_http2.c | |
@@ -1070,10 +1070,10 @@ cmd_var_resolve(struct stream *s, char *spec, char *buf) | |
*/ | |
else if (!strcmp(spec, "stream.window")) { | |
if (s->id) { | |
- snprintf(buf, 20, "%ld", s->ws); | |
+ snprintf(buf, 20, "%lld", s->ws); |
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
// ObjectKeyVal | |
// Dot | |
// Sub | |
var obj = { | |
'hoge': 'val' | |
}; | |
var obj2 = { | |
foo: 'val' |
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
class AController < ApplicationController | |
after_action :f, if: -> { response.status == 200 } | |
def f | |
end | |
def x | |
head 200 # call f | |
# head 404 # not call f | |
end |
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
'use strict'; | |
var fn = function (hoge, fuga) { | |
console.log(hoge); | |
}; | |
// > jslint --indent=2 fn.js | |
// fn.js | |
// #1 Unused 'fuga'. |
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
build: copy.js deps | |
zip -r copy.zip copy.js node_modules > /dev/null 2>&1 | |
deps: | |
npm install | |
.PHONY: zip deps |
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
type AdLogger struct { | |
mu sync.Mutex | |
Path string | |
Out *os.File | |
buf []byte | |
} | |
func (l *AdLogger) Write(log logs.Log) { | |
l.mu.Lock() | |
defer l.mu.Unlock() |
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
require 'geoip' | |
require 'benchmark' | |
n = 1000000 | |
# geoip-c C extended library | |
Benchmark.bm do |x| | |
geoip = GeoIP::City.new("/usr/share/GeoIP/GeoLiteCity.dat", :memory, false) | |
x.report { n.times { geoip.look_up("144.206.125.148") } } | |
# user system total real |
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 ( | |
"fmt" | |
"golang.org/x/crypto/bcrypt" | |
) | |
const ( | |
password = "hello" |