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 Plack::Builder; | |
use Plack::Request; | |
use File::Slurp; | |
use File::Temp; | |
use MIME::Base64; | |
my $app = sub { | |
my $req = Plack::Request->new(shift); | |
my $res = $req->new_response(200); |
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
#!/usr/bin/env perl | |
use strict; | |
use warnings; | |
use File::Slurp; | |
use MIME::Base64; | |
use Plack::MIME; | |
my $file = shift or die "usage: $0 file¥n"; | |
my $mime = Plack::MIME->mime_type($file) or die "Cannot find MIME type for $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
javascript:(function(){window.open('http://web.archive.org/web/*/'+location.href,'_blank')})() |
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
javascript:(function(){alert('http://amazon.jp/dp/'+document.getElementById('ASIN').value)})() |
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
// "?a=1&a=2&b=x&c=%2A&d=&=y&=&==&%2A=3&" -> Object {a: "2", b: "x", c: "*", d: "", %2A: "3"} | |
var q = (function(){ | |
var q = {}; | |
window.location.search | |
.substring(1) | |
.split('&') | |
.filter(function(a){ | |
return a.indexOf('=') > 0; | |
}) | |
.forEach(function(a){ |
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
#!/bin/bash | |
# | |
# $ ./lame.sh something.aiff | |
# | |
set -e | |
for FILE in "$@"; do | |
FACTOR=`sox $FILE -n stat -v 2>&1` | |
TMP=${FILE%.*}.tmp.aiff | |
sox -v $FACTOR $FILE -t aiff $TMP | |
echo "normalize $FILE with factor $FACTOR -> $TMP" |
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
<!DOCTYPE html> | |
<meta charset="UTF-8"> | |
<title>requestAnimationFrame Test</title> | |
<div id="area" style="border:1px solid black;width:100px;height:100px"></div> | |
<p>Counting up backgroundly, in 120 fps. requestAnimationFrame will be activated by hover.</p> | |
<script src="http://ajax.googleapis.com/ajax/libs/jquery/2.0.3/jquery.min.js"></script> | |
<script> | |
$(function(){ |
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
<!DOCTYPE html> | |
<meta charset="UTF-8"> | |
<title>Economic Drawing Test</title> | |
<div id="area" style="border:1px solid black;width:200px;height:200px;"></div> | |
<p>Mouse-move draws X, Y, and num of drawn times.</p> | |
<script src="http://ajax.googleapis.com/ajax/libs/jquery/2.0.3/jquery.min.js"></script> | |
<script> | |
$(function(){ |
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
javascript:(function(){document.getElementsByTagName("body")[0].removeAttribute("oncontextmenu")})() |
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(window, confirmText){ | |
confirmText = confirmText || "New App version found, Restart now?"; | |
var cache = window.applicationCache; | |
// ApplicationCache not supported... | |
if (!cache) { | |
return; | |
} | |
// Add Listener to reload contents before updating manually. |
OlderNewer