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
var snap = (function (floor) { | |
function calc(value, step) { | |
return floor(value / step) * step + step; | |
} | |
return function snap(value, action, step) { | |
switch (action) { | |
case '+': return calc(value, +step); | |
case '-': return calc(value, -step); | |
} | |
}; |
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 PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> | |
<html> | |
<head> | |
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> | |
<title>メモリリーク</title> | |
</head> | |
<body> | |
<p> | |
<big id="out">0</big> バイト<br> | |
<samp id="err">#text</samp> |
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
var child_process = require('child_process'); | |
var math = (function (command) { | |
var wolfram = child_process.spawn(command); | |
var stdin = wolfram.stdin; | |
function Args(expr, callback) { | |
this.expr = String(expr); | |
if (typeof callback == 'function') | |
this.callback = callback; |
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.prototype.curry = (function (undefined) { | |
function copy(args) { | |
var length = args.length; | |
var array = Array(length); | |
for (var i = 0; i < length; i++) array[i] = args[i]; | |
return array; | |
} | |
function curry(length) { | |
var fn = this; | |
if (length === undefined) length = this.length; |
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
/* | |
Divide(100).into(1, 2, 3); // [17, 33, 50] | |
*/ | |
function Divide(number) { | |
if (this instanceof Divide) | |
this.number = number; | |
else return new Divide(number); | |
} | |
Divide.prototype.into = 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
function lazy(handler, timeout, continuous) { | |
var self, args; | |
var timeoutId, intervalId; | |
function call() { | |
handler.apply(self, args); | |
} | |
function onTimeout() { | |
if (continuous) clearInterval(intervalId); | |
else call(); |
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
@ECHO OFF | |
SET suspended="%TMP%\KCSuspended" | |
IF EXIST %suspended% ( | |
DEL %suspended% | |
SET option=/r | |
) ELSE ( | |
COPY NUL %suspended% > NUL | |
SET option= |
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
@ECHO OFF | |
SET guid=f0ad9da6-d3ea-4be6-8f04-821665acce60 SUB_PROCESSOR PROCTHROTTLEMAX | |
SET "ac=現在の AC 電源設定のインデックス: " | |
FOR /F "tokens=2 delims=:" %%i IN ('POWERCFG /QUERY %guid% ^| FIND "%ac%"') DO SET /A i=%%i | |
ECHO %ac%%i% | |
ECHO. | |
SET /P index="最大のプロセッサの状態>" | |
POWERCFG /SETACVALUEINDEX %guid% %index% |
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 ($) { | |
var t = $.querySelector('.map-tiles'); | |
var v = $.querySelector('.map-viewport'); | |
v.style.width = t.style.width; | |
v.style.height = t.style.height; | |
$.body.innerHTML = ''; | |
$.body.appendChild(t); | |
$.body.style.overflow = ''; | |
})(document); |
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 PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> | |
<html lang="ja-JP"> | |
<head> | |
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> | |
<meta http-equiv="Content-Style-Type" content="text/css"> | |
<meta http-equiv="Content-Script-Type" content="text/javascript"> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
<title>#text</title> | |