Skip to content

Instantly share code, notes, and snippets.

View tcdw's full-sized avatar
😵
啊啊啊啊啊啊啊啊(

tcdw tcdw

😵
啊啊啊啊啊啊啊啊(
View GitHub Profile
@tcdw
tcdw / convertEcho.js
Created March 10, 2019 15:47
echo ripper
function convertEchoVolume(masterL, masterR, echoL, echoR) {
const mL = masterL > 127 ? 256 - masterL : masterL;
const mR = masterR > 127 ? 256 - masterR : masterR;
const eL = echoL > 127 ? 256 - echoL : echoL;
const eR = echoR > 127 ? 256 - echoR : echoR;
return {
echoL: eL * 128 / mL,
echoR: eR * 128 / mR
};
}
@tcdw
tcdw / sleep_sort_fast.js
Created November 11, 2018 10:23
Sleep Sort 高速版(JavaScript)
const num = [5, 7, 33, 23, 113, 6, 15, 1];
const sorted = [];
let count = 0;
while (num.length > 0) {
for (let i = 0; i < num.length; i += 1) {
if (num[i] === count) {
sorted.push(count);
num.splice(i, 1);
break;
@tcdw
tcdw / generate-password.js
Created October 5, 2018 14:20
生成密码(Node.js
const generatePassword = (length) => {
const data = [];
for (let i = 0; i < length; i += 1) {
data.push(Math.floor(Math.random() * 94) + 33);
}
return Buffer.from(data).toString('utf8');
};
module.exports = generatePassword;
@tcdw
tcdw / 403.html
Created March 2, 2018 08:39
五年以后我终于给自己糊了套像模像样的错误页面
<!-- by tcdw, CC 4.0 BY -->
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="theme-color" content="#0277bd">
<meta name="renderer" content="webkit">
<meta name="viewport" content="width=device-width, maximum-scale=1, initial-scale=1">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
@tcdw
tcdw / keybase.md
Created March 1, 2018 05:57
keybase.md

Keybase proof

I hereby claim:

  • I am tcdw on github.
  • I am tcdw (https://keybase.io/tcdw) on keybase.
  • I have a public key ASA89vlqJEWkDz0Pidbfvrraep2SUJAEJE_rsrepZ9CQugo

To claim this, I am signing this object:

@tcdw
tcdw / import_data.js
Created February 16, 2018 12:56
https://bbs.nyaa.cat/d/1236 里的长老数据转换为 voxelmap 坐标点数据格式
const grandFather = [
["新北市", "石印长老", "806", "64", "-3556"],
["千里田町", "水歌长老", "-934", "98", "-1216"],
["X湾", "幽林长老", "1553", "63", "2444"],
["南方主城", "晨露長老", "222", "68", "2605"],
["亡灵幻境", "月矛长老", "2614", "68", "2447"],
["东海望", "月击长老", "1537", "69", "1716"],
["永恒霜风", "霜风长老", "4445", "135", "235"],
["西方主城", "深爐長老", "-2547", "69", "246"],
["动漫流行馆", "黑羽长老", "1525", "122", "-1374"],
@tcdw
tcdw / super_weapon.md
Last active February 7, 2018 15:58
武器试用记

今天,卷卷在 EpicWorld 黑化前线提供武器试用,有多种很难兑换的和限定的武器都可以试用了,我太激动了!

禁忌「莱瓦汀」

首先我试用的是《禁忌「莱瓦汀」》。为什么我一开始就打算试用,是因为它的面板上写着震撼人心的信息。但是我开始试用了,才发现它比我想象中的还要强大!

我对准很多僵尸使劲挥动我的《禁忌「莱瓦汀」》,只见它们一个又一个的一命呜呼。当武器的充能饱满,我轻轻点击了鼠标,只见我飞到了天上,下面的怪物受到了震撼人心的伤害(然而我总是失明,所以看不到震撼的画面,好气啊)。当我不再失明,我看到身边全是火焰。真是太可怕了!

用这种武器攻击黑化怪,我一定能够早日拿到 0x0,实现我的梦想!

@tcdw
tcdw / hard.md
Created January 24, 2018 07:26
听说你这枚非 geek 想建个独立博客

然而为什么很多人最后放弃了建设独立博客?我们看看。

博客程序的选择

也许你以前只听说过 WordPress 之类的程序,但直到你真的去了解,才发现博客程序的轮子竟然这么多!不同编程语言、不同实现方法、不同思想的博客程序,应有尽有,让你的选择困难症爆发。

托管平台

要让别人看到你的博客,总得找个地方托管起来吧?

@tcdw
tcdw / nyaa.md
Last active March 17, 2020 02:29
喵窝常用命令速查表
#!/usr/bin/env node
// 奇怪的图片特效
// 使用前请先 npm install bmp-js
// by tcdw <[email protected]>
// 脚本以 BSD-3-Clause 许可证发布
var boundW = 8;
var boundH = 8;