This file contains hidden or 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(){ | |
jQuery.fn.__init = jQuery.fn.init; | |
var old_expr = /^(?:[^<]*(<[\w\W]+>)[^>]*$)/; | |
var strict_expr = /^\s*</; | |
jQuery.fn.init = function(selector, context, rootjQuery){ | |
if (typeof selector === "string") { | |
// console.log(selector); | |
if (old_expr.test(selector) && !strict_expr.test(selector)) { | |
throw 'Syntax error, html string must start with "<"'; | |
} |
This file contains hidden or 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 Plack::BenchmarkerBuilder; | |
use strict; | |
use warnings; | |
use parent 'Plack::Builder'; | |
use Time::HiRes 'time'; | |
sub import { | |
my $class = shift; | |
Plack::Builder->export_to_level(1, @_); |
This file contains hidden or 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
> perl -E 'say "生" & "死"' | |
愛 | |
生 Life U+751F \xe7\x94\x9f 11100111 10010100 10011111 | |
死 Death U+6B7B \xe6\xad\xbb 11100110 10101101 10111011 | |
愛 Love u+611B \xe6\x84\x9b 11100110 10000100 10011011 |
This file contains hidden or 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
// Written in the D programming language. | |
/** | |
* High peformance downloader | |
* | |
* Implemented according to <a href="http://yusukebe.com/archives/20120229/072808.html">this implementation</a>. | |
* | |
* Example: | |
* ----- | |
* dmd -L-lcurl -run downloader.d |
This file contains hidden or 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://www.ninja.co.jp/rule/analyze | |
図1 | |
訪問者 → 忍者ツールズ → 業務提携先 | |
↓ | |
サイト運営者 | |
この場合、業務提携先、業務委託先に「忍者ツールズが知っているデータ」の中で「忍者ツールズが第三者に提供しても大丈夫だと考えている情報」が共有されることになる。 | |
それは利用規約とかプライバシーポリシーに、統計データのみとか、個人を特定できないようにするとか、必要な範囲でとか、守秘義務を結んだ上で、とか書かれるのが一般的。 |
This file contains hidden or 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
// Eg.: http://cho45.github.com/tasscss/ | |
(function () { | |
var scripts = document.getElementsByTagName('script'); | |
var script = scripts[scripts.length-1]; | |
var container = document.createElement('div'); | |
script.parentNode.insertBefore(container, script); | |
var callback; do { | |
callback = 'jsonp' + Math.floor(Math.random() * 0xffff); |
This file contains hidden or 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
#!/usr/bin/env ruby | |
require 'json' | |
require 'open-uri' | |
require 'open3' | |
require 'date' | |
class Importer | |
attr_reader :screen_name |
This file contains hidden or 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
--- nginx-1.1.14.orig/src/http/ngx_http_upstream.c 2012-01-19 00:07:43.000000000 +0900 | |
+++ nginx-1.1.14/src/http/ngx_http_upstream.c 2012-02-09 17:11:02.000000000 +0900 | |
@@ -3426,6 +3426,13 @@ | |
r->upstream->headers_in.connection_close = 1; | |
} | |
+ if (ngx_strlcasestrn(h->value.data, h->value.data + h->value.len, | |
+ (u_char *) "keep-alive", 10 - 1) | |
+ != NULL) | |
+ { |
This file contains hidden or 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
$ curl -kL https://raw.github.com/riywo/App-llenv/master/llenv-install | bash | |
and add your .bashrc or something | |
export LLENV_ROOT=$HOME/llenv | |
export LLENV_OSTYPE=`$LLENV_ROOT/bin/ostype` | |
export PATH=$LLENV_ROOT/bin:$PATH | |
$ llinstall init perl | |
$ llinstall install perl perl-5.14.2 |
This file contains hidden or 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 POSIX qw(strftime sysconf _SC_CLK_TCK); | |
use File::Slurp; | |
use Time::Piece; | |
use Time::HiRes qw(time); | |
my $TIME_OF_BOOT = time_of_boot(); | |
my $CLOCK_TICK = sysconf(_SC_CLK_TCK); | |
MAIN: { | |
my $pid = shift or die "missing PID"; |