Initial commit

main
Pk11 3 years ago
commit c357e7dd40

1
.gitignore vendored

@ -0,0 +1 @@
count.txt

@ -0,0 +1,5 @@
# ピケ.コム
ピケ.コムのホームページや様々なランダム小さなページ
the ピケ.コム home page and various other random little pages

@ -0,0 +1,5 @@
<?php
header("Content-Type: text/plain");
echo $_SERVER['HTTP_USER_AGENT'];

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 KiB

@ -0,0 +1,72 @@
if(String.prototype.padStart == null) {
String.prototype.padStart = function(length, fill) {
var padding = "";
while(padding.length + this.length < length)
padding += fill.substr(0, length - (padding.length + this.length));
return padding + this;
}
}
try {
eval("let x;"); // this will break the try catch pre-ECMAScript 6
var html5 = document.getElementsByClassName("html5");
for(var i = 0; i < html5.length; i++) {
html5[i].classList.remove("html5");
}
} catch(e) {}
function updateColor(color) {
var rgb = [0, 0, 0];
// Parse into RGB values
if(typeof color == "object") { // Split RGB
var colors = color.getElementsByTagName("input");
for(var i = 0; i < colors.length; i++) {
rgb[i] = parseInt(colors[i].value);
}
} else {
// Remove any extra formatting
color = color.toLowerCase().replace(/\s+/g, " ").replace(/#/g, "").replace(/0x/g, "");
if(color.length == 3) { // Three digit hex
for(var i = 0; i < rgb.length; i++)
rgb[i] = parseInt(color[i] + color[i], 16);
} else if(color.length == 6) { // Six digit hex
for(var i = 0; i < rgb.length; i++)
rgb[i] = parseInt(color.substr(i * 2, 2), 16);
} else if(color.length == 4) { // BGR15
var val = parseInt(color, 16);
rgb[0] = Math.round(( val & 0x1F) * 255 / 31);
rgb[1] = Math.round(((val >> 0x5) & 0x1F) * 255 / 31);
rgb[2] = Math.round(((val >> 0xA) & 0x1F) * 255 / 31);
} else {
return alert("Error: Invalid color!");
}
}
// Ensure the colors are valid
for(var i = 0; i < rgb.length; i++) {
if(rgb[i] < 0x00 || rgb[i] > 0xFF)
return alert("Error: Invalid color!");
}
// Write to all inputs
var hex = "#";
for(var i = 0; i < rgb.length; i++)
hex += rgb[i].toString(16).padStart(2, "0").toUpperCase();
document.getElementById("html-text").value = hex;
document.getElementById("html-color").value = hex;
var bgr15 = ((Math.round(rgb[2] * 31 / 255) & 0x1F) << 10 | (Math.round(rgb[1] * 31 / 255) & 0x1F) << 5 | (Math.round(rgb[0] * 31 / 255) & 0x1F));
document.getElementById("bgr15-no-bit15").value = "0x" + bgr15.toString(16).padStart(4, "0").toUpperCase();
document.getElementById("bgr15-bit15").value = "0x" + (bgr15 | 1 << 15).toString(16).padStart(4, "0").toUpperCase();
document.getElementById("rgb-r").value = rgb[0];
document.getElementById("rgb-g").value = rgb[1];
document.getElementById("rgb-b").value = rgb[2];
document.getElementById("preview").style.backgroundColor = hex;
}
updateColor("#000000");

@ -0,0 +1,83 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!--
This is free and unencumbered software released into the public domain.
Anyone is free to copy, modify, publish, use, compile, sell, or
distribute this software, either in source code form or as a compiled
binary, for any purpose, commercial or non-commercial, and by any
means.
In jurisdictions that recognize copyright laws, the author or authors
of this software dedicate any and all copyright interest in the
software to the public domain. We make this dedication for the benefit
of the public at large and to the detriment of our heirs and
successors. We intend this dedication to be an overt act of
relinquishment in perpetuity of all present and future rights to this
software under copyright law.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.
For more information, please refer to <https://unlicense.org>
-->
<title>BIOS Shrinker</title>
</head>
<body>
<label for="file-input">Select BIOS dumper save file:</label>
<input id="file-input" type="file" onchange="shrinkBios(this.files[0])">
<script src="https://geraintluff.github.io/sha256/sha256.min.js"></script>
<script>
const gbaSha = "fd2547724b505f487e6dcb29ec2ecff3af35a841a77ab2e85fd87350abd36570";
const dsSha = "782eb3894237ec6aa411b78ffee19078bacf10413856d33cda10b44fd9c2856b";
function shrinkBios(file) {
// Check that the file is 32 KiB
if(file.size != 32 << 10)
return alert("Error! This is not a correct GBA BIOS dumper save.");
// Read the file
var reader = new FileReader();
reader.readAsArrayBuffer(file);
reader.onload = function() {
var array = new Uint8Array(this.result);
// Trim to 16 KiB
array = array.subarray(0, 16 << 10);
// Check hash
var bStr = "";
for(i in array)
bStr += String.fromCharCode(array[i]);
var sha = sha256(bStr);
if(sha == gbaSha || sha == dsSha) {
// Download trimmed file
var blob = new Blob([array], {type: "application/octet-stream"});
var a = document.createElement("a");
var url = window.URL.createObjectURL(blob);
a.href = url;
a.download = "bios.bin";
a.click();
window.URL.revokeObjectURL(url);
alert("Done! Checksum matches as a correct BIOS dump from a " + (sha == gbaSha ? "GBA" : "DS") + ".\n\nSHA-256: " + sha);
} else {
alert("Error! Trimmed BIOS checksum does not match a valid GBA BIOS checksum.\n\nSHA-256: " + sha);
}
};
}
</script>
</body>
</html>

@ -0,0 +1,82 @@
<!DOCTYPE html>
<html lang="ja">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>色変換</title>
<style>
label {
display: block;
}
#preview {
width: 100%;
height: 200px;
}
.r {
color: red;
}
.g {
color: green;
}
.b {
color: blue;
}
.html5 {
display: none;
}
</style>
</head>
<body>
<h1>色変換</h1>
<p>
[<a href="//xn--rck9c.xn--tckwe">戻る</a>]
</p>
<h2>HTML式16進</h2>
<input type="text" id="html-text" onchange="updateColor(this.value)">
<input type="color" id="html-color" class="html5" onchange="updateColor(this.value)">
<hr>
<h2>RGB</h2>
<div id="rgb">
<label class="r">
<input type="number" id="rgb-r" min="0" max="255" onchange="updateColor(document.getElementById('rgb'))">
</label>
<label class="g">
<input type="number" id="rgb-g" min="0" max="255" onchange="updateColor(document.getElementById('rgb'))">
</label>
<label class="b">
<input type="number" id="rgb-b" min="0" max="255" onchange="updateColor(document.getElementById('rgb'))">
</label>
</div>
<hr>
<h2>BGR15</h2>
<label>
<input type="text" id="bgr15-no-bit15" onchange="updateColor(this.value)">
ビット15なし時々に透明
</label>
<label>
<input type="text" id="bgr15-bit15" onchange="updateColor(this.value)">
ビット15あり
</label>
<hr>
<h2>プレビュー</h2>
<div id="preview"></div>
<script src="/assets/js/color.js"></script>
</body>
</html>

@ -0,0 +1,25 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Echo - ピケ.コム</title>
<meta name="description" lang="en" content="<?php echo $_GET['s']; ?>">
<style>
pre {
background-color: #f8f8f8;
border-radius: 0.5rem;
padding: 1rem;
}
</style>
</head>
<body>
<pre id="content"><?php echo $_GET['s']; ?></pre>
<input type="button" onclick="copy()" value="Copy">
<script>
function copy() {
navigator.clipboard.writeText(document.getElementById("content").innerText);
}
</script>
</body>
</html>

@ -0,0 +1,82 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Color Converter</title>
<style>
label {
display: block;
}
#preview {
width: 100%;
height: 200px;
}
.r {
color: red;
}
.g {
color: green;
}
.b {
color: blue;
}
.html5 {
display: none;
}
</style>
</head>
<body>
<h1>Color Converter</h1>
<p>
[<a href="//xn--rck9c.xn--tckwe/en/">back</a>]
</p>
<h2>HTML-Style Hex</h2>
<input type="text" id="html-text" onchange="updateColor(this.value)">
<input type="color" id="html-color" class="html5" onchange="updateColor(this.value)">
<hr>
<h2>RGB</h2>
<div id="rgb">
<label class="r">
<input type="number" id="rgb-r" min="0" max="255" onchange="updateColor(document.getElementById('rgb'))">
Red
</label>
<label class="g">
<input type="number" id="rgb-g" min="0" max="255" onchange="updateColor(document.getElementById('rgb'))">
Green
</label>
<label class="b">
<input type="number" id="rgb-b" min="0" max="255" onchange="updateColor(document.getElementById('rgb'))">
Blue
</label>
</div>
<hr>
<h2>BGR15</h2>
<label>
<input type="text" id="bgr15-no-bit15" onchange="updateColor(this.value)">
Bit 15 not set (sometimes transparent)
</label>
<label>
<input type="text" id="bgr15-bit15" onchange="updateColor(this.value)">
Bit 15 set
</label>
<hr>
<h2>Preview</h2>
<div id="preview"></div>
<script src="/assets/js/color.js"></script>
</body>
</html>

@ -0,0 +1,63 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>ピケ.コム</title>
</head>
<body>
<header>
<h1>Welcome to <ruby><img src="/assets/images/header/wordart.gif" alt="ピケ.コム" width="230" height="55"><rp> (</rp><rt>pk . com</rt><rp>) </rp></ruby>!</h1>
<p>This is <a href="//pk11.us">Pk11</a>'s personal website where I put random little things. For my main projects see <a href="//pk11.us">pk11.us</a>.</p>
<p><a href="/"><span lang="ja">日本語ページ・</span>Japanese page</a></p>
<hr>
</header>
<main>
<h2>Pages</h2>
<dl>
<dt><a href="//bad-apple.xn--rck9c.xn--tckwe/index.html">bad-apple</a></dt>
<dd>Bad Apple!! but it's pure HTML (no JS or CSS)</dd>
<dt><a href="//bbs.xn--rck9c.xn--tckwe/index.php">bbs</a></dt>
<dd>A really crappy single thread BBS I made in PHP because I was bored and couldn't upload an image from Windows 98</dd>
<dt><a href="/bios-shrinker.html">bios-shrinker</a></dt>
<dd>Shrinks a BIOS dump from a 3DS to the correct size</dd>
<dt><a href="color.html">color</a></dt>
<dd>Convert between hex, RGB, and BGR15 colors</dd>
<dt><a href="/dQw4w9WgXcQ">dQw4w9WgXcQ</a></dt>
<dd aria-label="Winking face">;)</dd>
<dt><a href="//grit.xn--rck9c.xn--tckwe">grit</a></dt>
<dd>Converts images to GRF files using <a href="https://github.com/devkitPro/grit">grit</a></dd>
<dt><a href="//haste.xn--rck9c.xn--tckwe">haste</a></dt>
<dd>Self-hosted <a href="//hastebin.com">Hastebin</a> with light theme</dd>
<dt><a href="//nextrip.xn--rck9c.xn--tckwe">nextrip</a> (Japanese)</dt>
<dd>Bus stop info viewer using <a href="//metrotransit.org">Metro Transit</a>'s NexTrip API</dd>
<dt><a href="//rss.xn--rck9c.xn--tckwe">rss</a></dt>
<dd>Self hosted <a href="//miniflux.app">Miniflux</a></dd>
<dt><a href="//uwu.xn--rck9c.xn--tckwe">uwu</a></dt>
<dd>Random uwu face</dd>
<dt><a href="/video.php">video</a></dt>
<dd>Makes videos show in embeds</dd>
<dt><ruby><a href="//xn--p8juc.xn--rck9c.xn--tckwe">うち</a><rp> (</rp><rt>uchi</rt><rp>) </rp></ruby> (Japanese)</dt>
<dd>Home</dd>
</dl>
</main>
<footer>
<hr>
<p>2021-2022 <a href="//pk11.us">Pk11</a></p>
</footer>
</body>
</html>

@ -0,0 +1,38 @@
<?php
$timesLoaded = intval(file_get_contents("count.txt")) + 1;
file_put_contents("count.txt", $timesLoaded);
$timesLoaded = number_format($timesLoaded);
?>
<!DOCTYPE html>
<html lang="ja">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>home.pk11.us</title>
<meta name="description" lang="ja" content="‎       へ
      / \        よ
     / 日 \       う
    /     \  __  こ
  _ |  へ  | /##\ そ
 /#\|日 冂 日| \##/ ︒
 \#/|  凵  |  ||
 ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄\ || 
             ̄ ̄ ̄ ̄ ̄ ̄
このページは<?php echo $timesLoaded; ?>回読み込みました。">
</head>
<body>
<pre style="line-height: 1;">
       へ
      / \        よ
     / 日 \       う
    /     \  __  こ
  _ |  へ  | /##\ そ
 /#\|日 冂 日| \##/ ︒
 \#/|  凵  |  ||
 ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄\ || 
             ̄ ̄ ̄ ̄ ̄ ̄
このページは<?php echo $timesLoaded; ?>回読み込みました。
</pre>
</body>
</html>

@ -0,0 +1,37 @@
<?php
$timesLoaded = intval(file_get_contents("count.txt")) + 1;
file_put_contents("count.txt", $timesLoaded);
$timesLoaded = number_format($timesLoaded);
?>
<!DOCTYPE html>
<html lang="ja">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>うち.ピケ.コム</title>
<meta name="description" lang="ja" content="‎       ____  ようこそ、 #
      /【||】\______##   ##
 _____|【||】|  【口口】### ##
/ ___ \  ̄ ̄ |冂     ######
||   ||ーーーー|凵     |####
|| ・ ||#口口#/ー\【口口】| ##
 ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄\||
   うち・ピケ・コムへ         ̄ ̄ ̄
このページは<?php echo $timesLoaded; ?>回読み込みました。">
</head>
<body>
<pre style="line-height: 1;">
       ____  ようこそ、 #
      /【||】\______##   ##
 _____|【||】|  【口口】### ##
/ ___ \  ̄ ̄ |冂     ######
||   ||ーーーー|凵     |####
|| ・ ||#口口#/ー\【口口】| ##
 ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄\||
   うち・ピケ・コムへ         ̄ ̄ ̄
</pre>
このページは<?php echo $timesLoaded; ?>回読み込みました。
</pre>
</body>
</html>

@ -0,0 +1,63 @@
<!DOCTYPE html>
<html lang="ja">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>ピケ.コム</title>
</head>
<body>
<header>
<h1>ようこそ、<img src="/assets/images/header/wordart.gif" alt="ピケ.コム" width="230" height="55">へ!</h1>
<p>これは、<a href="//pk11.us">Pk11</a>の個人的なWebサイトです。ここではランダムな小さなものがある、主なものは<a href="//pk11.us">pk11.us</a>にあります。</p>
<p><a href="/en/">英語ページ・<span lang="en">English page</span></a></p>
<hr>
</header>
<main>
<h2>ページ</h2>
<dl>
<dt><a href="//bad-apple.xn--rck9c.xn--tckwe/ja.html">bad-apple</a></dt>
<dd>Bad Apple!!でも、HTMLだけです(JSやCSSなし)</dd>
<dt><a href="//bbs.xn--rck9c.xn--tckwe/index.php">bbs</a>(英語)</dt>
<dd>Windows98から画像をアップロードできないでしたので、PHPで作って本当にしょぼい1スレBBS</dd>
<dt><a href="bios-shrinker.html">bios-shrinker</a>(英語)</dt>
<dd>3DSからダンプされたBIOSファイルを正しいサイズに縮小</dd>
<dt><a href="color.html">color</a></dt>
<dd>16進、RGB、BGR15の間で色を変換</dd>
<dt><a href="dQw4w9WgXcQ">dQw4w9WgXcQ</a></dt>
<dd aria-label="ウィンク顔">;)</dd>
<dt><a href="//grit.xn--rck9c.xn--tckwe">grit</a>(英語)</dt>
<dd>イメージを<a href="https://github.com/devkitPro/grit">grit</a>を使用してGRFファイルに変換</dd>
<dt><a href="//haste.xn--rck9c.xn--tckwe">haste</a>(英語)</dt>
<dd>自己ホストのライト配色あり<a href="//hastebin.com">Hastebin</a></dd>
<dt><a href="//nextrip.xn--rck9c.xn--tckwe">nextrip</a></dt>
<dd><a href="//metrotransit.org">Metro Transit</a>のNexTrip APIを使うバス停留所情報ビューアー</dd>
<dt><a href="//rss.xn--rck9c.xn--tckwe">rss</a></dt>
<dd>自己ホトスの<a href="//miniflux.app">Miniflux</a></dd>
<dt><a href="//uwu.xn--rck9c.xn--tckwe">uwu</a></dt>
<dd>ランダムなuwu顔</dd>
<dt><a href="video.php">video</a>(英語)</dt>
<dd>埋め込みにビデオを表示</dd>
<dt><a href="//xn--p8juc.xn--rck9c.xn--tckwe">うち</a></dt>
<dd></dd>
</dl>
</main>
<footer>
<hr>
<p>2021-2022 <a href="//pk11.us">Pk11</a></p>
</footer>
</body>
</html>

@ -0,0 +1,48 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Discord song embedder</title>
<link rel="canonical" href="https://home.pk11.us/song.php">
<meta property="og:url" content="https://home.pk11.us/song.php">
<meta property="title" content="Discord song embedder">
<?php $song = str_replace(' ', '%20', $_GET['song']); ?>
<?php if($song) { ?>
<meta property="og:audio" content="<?php echo $song ?>">
<meta property="og:audio:secure_url" content="<?php echo $song ?>">
<meta property="og:audio:type" content="audio/wav">
<meta property="og:type" content="music.song">
<meta name="twitter:player" content="<?php echo $song ?>">
<meta name="twitter:player:stream" content="<?php echo $song ?>">
<meta name="twitter:player:stream:content_type" content="audio/wav">
<style>
*, body, html, audio, source {
margin: 0;
padding: 0;
}
audio {
width: 100%;
height: auto;
}
</style>
<?php } else { ?>
<meta name="description" content="Put ?song=[link to song] at the end of the URL and Discord will show an embed of that song.">
<?php } ?>
</head>
<body>
<?php if($song) { ?>
<audio controls autoplay>
<source src="<?php echo $song ?>" type="audio/wav">
</audio>
<?php } else { ?>
<p>Put ?song=[link to song] at the end of the URL and Discord will show an embed of that song.</p>
<?php } ?>
</body>
</html>

@ -0,0 +1,46 @@
<?php
function face() {
$eyes = ['O', 'o', 'U', 'u', '>', '<', '^', '-', 'X', 'T', 'q'];
$mouths = ['w', 'u', 'o', '_', '-', 'x', '///', 'ω'];
$extras = [['', ''], ['', ''], ['', ''], ['', '-☆'], ['=', '='], ['d', 'b♪'], ['ξ(', ')ξ']];
$eye = $eyes[rand(0, count($eyes) - 1)];
$mouth = '';
do {
$mouth = $mouths[rand(0, count($mouths) - 1)];
} while(strcasecmp($mouth, $eye) == 0);
$extra = $extras[rand(0, count($extras) - 1)];
return $extra[0] . $eye . $mouth . $eye . $extra[1];
}
// This is my fallback error page
if($_SERVER['HTTP_HOST'] != 'uwu.xn--rck9c.xn--tckwe')
http_response_code(404);
// Return source code
if(isset($_GET['source'])) {
header("Content-Type: text/plain");
die(file_get_contents(basename($_SERVER['PHP_SELF'])));
}
// Plaintext
if(isset($_GET['raw'])) {
header("Content-Type: text/plain");
die(face());
}
$face = face();
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title><?php echo htmlspecialchars($face); ?></title>
<meta name="description" content="<?php echo $face; ?>">
</head>
<body>
<h1><?php echo htmlspecialchars($face); ?></h1>
</body>
</html>

@ -0,0 +1,52 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Discord video embedder</title>
<link rel="canonical" href="https://home.pk11.us/video.php">
<meta property="og:url" content="https://home.pk11.us/video.php">
<meta property="title" content="Discord video embedder">
<?php $video = str_replace(' ', '%20', $_GET['video']); ?>
<?php if($video) { ?>
<meta property="og:video" content="<?php echo $video ?>">
<meta property="og:video:secure_url" content="<?php echo $video ?>">
<meta property="og:video:width" content="0">
<meta property="og:video:height" content="0">
<meta property="og:video:type" content="video/mp4">
<meta property="og:type" content="video.other">
<meta name="twitter:player" content="<?php echo $video ?>">
<meta name="twitter:player:width" content="0">
<meta name="twitter:player:height" content="0">
<meta name="twitter:player:stream" content="<?php echo $video ?>">
<meta name="twitter:player:stream:content_type" content="video/mp4">
<style>
*, body, html, video, source {
margin: 0;
padding: 0;
}
video {
width: 100%;
height: auto;
}
</style>
<?php } else { ?>
<meta name="description" content="Put ?video=[link to video] at the end of the URL and Discord will show an embed of that video.">
<?php } ?>
</head>
<body>
<?php if($video) { ?>
<video controls autoplay>
<source src="<?php echo $video ?>" type="video/mp4">
</video>
<?php } else { ?>
<p>Put ?video=[link to video] at the end of the URL and Discord will show an embed of that video.</p>
<?php } ?>
</body>
</html>

@ -0,0 +1,8 @@
<?php
$r = $_GET['r'];
if(!empty($r))
header("Location: {$_GET['r']}", true, 307);
else
echo "Invalid redirect";
Loading…
Cancel
Save