Skip to content

Instantly share code, notes, and snippets.

View ShittyCodeMan's full-sized avatar

ShittyCodeMan ShittyCodeMan

View GitHub Profile
// 2.5%*90
const initialDamage = 2.25;
// 10%*90
const skillcheckFail = 9;
// 5%+90
const overchargeFail = 4.5;
function calcOverchargeDotTotal_v6_1_0(t) {
if (t < 0) {
return 0;
"Hello, World!".match(/.{1,6}/g).flatMap(a=>a.split("").map(a=>("0000000"+a.charCodeAt().toString(2)).slice(-8))).join("").match(/.{1,6}/g).map(a=>"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[parseInt((a+"00000").slice(0,6),2)]).join("").match(/.{1,4}/g).map(a=>(a+"===").slice(0,4)).join("");
/*
* 参考
* https://docs.microsoft.com/ja-jp/windows/win32/xaudio2/how-to--integrate-x3daudio-with-xaudio2
* https://qiita.com/tobira-code/items/39936c4e2b1168fb79ce
* https://setuna-kanata.hatenadiary.org/entry/20091220/1261327604
*/
#include <thread>
#include <vector>
#include <stdio.h>
@ShittyCodeMan
ShittyCodeMan / CoinFlip.js
Last active March 5, 2022 15:25
Bitburner scripts
/** @param {NS} ns **/
// Credit: https://steamcommunity.com/sharedfiles/filedetails/?id=2704596369
export async function main(ns) {
ns.disableLog('sleep');
ns.tail();
let doc = self["document"];
while(doc.querySelector("button+h4")?.textContent !== "Iker Molina Casino"
|| doc.querySelector("input+button")?.textContent !== "Head!") {
t*(t>>9|t>>13)&16
(((t/1e7*t*t+t)%127|t>>4|t>>5|t%127+(t>>16)|t)&255)*.3
(((t&t%255)-(t*3&t>>13&t>>6))&255)*.1
t>>4|t&((t>>5)/(t>>7-(t>>15)&-t>>7-(t>>15)))
(((t*9&t>>4|t*5&t>>7|t*3&t/1024)-1)&255)*.1
(((t/2*(15&(0x234568a0>>(t>>8&28))))|t/2>>(t>>11)^t>>12)+(t/16&t&24)&255)*.1//44100
((((t*("36364689"[t>>13&7]&15))/12&128)+(((((t>>12)^(t>>12)-2)%11*t)/4|t>>13)&127))&255)*.1//44100
d=(t*(t&t>>12)*8/11025)|0,((((d&16)/8-1)*(d*(d^15)+d+127))&255)*.1//44100
@ShittyCodeMan
ShittyCodeMan / Class.cs
Created June 10, 2021 18:39
The Backrooms Game FREE Edition - Showing madness value BepInEx mod
using HarmonyLib;
namespace BRMyMod
{
[HarmonyPatch(typeof(Watch), "Start")]
static class HarmonyPatch__Madness__updateMadnessText
{
static void Postfix(Madness ___madness)
{
___madness.madnessText.enabled = true;
@ShittyCodeMan
ShittyCodeMan / ExponentialMediaVolume.user.js
Last active February 13, 2021 07:51
video,audioタグのvolumeプロパティをフックして、指数関数的に操作できるようにする。
// ==UserScript==
// @name Exponential Media Volume
// @namespace http://tampermonkey.net/
// @version 0.1
// @description try to take over the world!
// @author You
// @match http*://*/*
// @grant GM_getValue
// @grant GM_setValue
// @grant GM_addValueChangeListener
from sys import argv
from os import path
import struct
with open(argv[1], mode="rb") as f:
png = f.read()
if struct.unpack_from(">16s", png, 0)[0] != b'\x89PNG\r\n\x1a\n\x00\x00\x00\rIHDR':
exit
w = struct.unpack_from(">I", png, 16)[0]
h = struct.unpack_from(">I", png, 20)[0]
const CREATIONS={
Light: {
cost: 1250,
requires: {}
},
Stone: {
cost: 1250,
requires: {}
},
Soil: {
// ==UserScript==
// @name Steam community item linker
// @namespace http://tampermonkey.net/
// @version 0.1
// @description try to take over the world!
// @author You
// @include https://steamcommunity.com/app/*/screenshots/*
// @include https://steamcommunity.com/app/*/images/*
// @include https://steamcommunity.com/sharedfiles/filedetails/?id=*
// @include https://steamuserimages-a.akamaihd.net/ugc/*