Skip to content

Instantly share code, notes, and snippets.

View dimdenGD's full-sized avatar
🧀
Cheese on Thursday

dimden dimdenGD

🧀
Cheese on Thursday
View GitHub Profile
@dimdenGD
dimdenGD / makeSeeableColor.js
Created June 29, 2023 16:44
Function to input color and background color that will change lightness of color to make it more seeable if contrast is too low
const RED = 0.2126;
const GREEN = 0.7152;
const BLUE = 0.0722;
const GAMMA = 2.4;
function luminance(r, g, b) {
const a = [r, g, b].map(v => {
v /= 255;
return v <= 0.03928
@dimdenGD
dimdenGD / lagrangeInterpolation.js
Last active April 28, 2023 20:31
Lagrange Interpolation in JavaScript
function lagrangeInterpolation(xs, ys, x) {
let y = 0;
for(let i = 0; i < xs.length; i++) {
let t = 1;
for(let j = 0; j < xs.length; j++) {
if(j !== i) {
t *= (x - xs[j]) / (xs[i] - xs[j]);
}
}
y += t * ys[i];
@dimdenGD
dimdenGD / gaussSeidel.js
Last active April 27, 2023 17:14
Gauss-Seidel method in javascript
function multiplyMatrices(A, B) {
let C = [];
for(let i = 0; i < A.length; i++) {
C[i] = [];
for(let j = 0; j < A[i].length; j++) C[i][j] = A[i][j] * B[i];
}
return C;
}
/*
Copyright 2019 dimden (dimden#1877)
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
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 OR COPYRIGHT HOLDERS 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 U
@dimdenGD
dimdenGD / jitterclick.js
Last active November 29, 2019 16:42
Jitterclicker
/*
Jitterclicker
Thing I made for Minecraft PVP.
I have bad mouse and I can only do 6 CPS (Clicks Per Second) but with this thing I can do 12 CPS. It doubleclicks every time you left-click.
Hotkey for enabling/disabling: CTRL+X. Plays high note on enable and low note on disable.
Installing for noobs:
1. Install node.js.
2. Create folder, put this file in there.
@dimdenGD
dimdenGD / old_chat.js
Last active November 4, 2018 13:05
Old chat for OWOP
var style = `/*! Generated by OPM*/@font-face{font-family:pixel-op;src:url(/font/pixeloperator.woff2) format("woff2"),url(/font/pixeloperator.woff) format("woff");font-weight:400;font-style:normal}::-webkit-scrollbar{width:16px;height:16px}::-webkit-scrollbar-corner{background-color:transparent}::-webkit-scrollbar-button{height:16px;width:16px;border:6px solid;border-image:url(/img/button.png) 6 repeat;background-image:url(/img/gui.png);background-color:#aba389;border-width:6px;background-origin:border-box;background-repeat:no-repeat}::-webkit-scrollbar-button:hover{background-color:#b8b29c}::-webkit-scrollbar-button:active{background-color:#8d8671;border-image:url(/img/button_pressed.png) 6 repeat}::-webkit-scrollbar-button:disabled{background-color:#8d8671;border-image:url(/img/button_pressed.png) 6 repeat}::-webkit-scrollbar-button:vertical:increment{background-position:-32px 0}::-webkit-scrollbar-button:vertical:increment:disabled{background-position:-48px 0}::-webkit-scrollbar-button:vertical:decrement{b
@dimdenGD
dimdenGD / opm.js
Last active November 3, 2018 09:49
OWOP Package Manager
var _0x3814=['woIpEsOvwq8Dw5DDhTFUwozDmDwj','w7rDlcOjFhfCt2FTWEc=','csKoOW1yw5g=','w4TCm8OZJA==','w7h3JBrDlw==','K8OJw4wE','w6gEPBnDjQ==','w5NRwrvCpA==','VcOQwp5sZg==','wpIIw4sxeWbChMOIAMO9w7RWMsOBZMKYwqohw7EwwqF9QWXDkcOew7Jjw6k8w5sBXsKKDsKyCWjCssOEwoXDqsKwwq0=','fRIsMcK7ZcOOXmZy','KgdNZUTCrcOkw5Fmw4ADDsOfUi/DpB8=','w6BEwrwlFw==','VCxefjc=','w4IPw7cEwp4=','B2/ClMOUOw==','4p2pB0HCu8OGw7BmwqLDlcOIwpDDjMOawpMSTeKapxEnY3sgw4g=','wq3Dk8KYcHDDtMOX8Jqru0I8aDVDXsKDw4w=','H8OGCmDDug==','RG/Ch8OYd8KJY8Oww5o=','w5vCiHIq','w5c+w5Qmwpo=','ADtXwrnDiQ==','TVbClGAQw5IvYC4CUMOsJUXDrSFSw6AuH8KCwojDqsODwqxvwpM=','w7rDlcOrJw==','w71vwqo=','bgjChMK7w7MiHcO2w5FzI8O8','ZBUiLQ==','HyEvwpVpew==','ZcOeScObwojCqQ==','w4hPwo0tP8Kow6hk','dMOdbsOCwqQ=','bEtpw74v','w4nCmMKOw5o5','H27Do0I3Z2o6DFnCr8OUwr7inrk=','KXDDuE4g','OUHCm8O5FQ==','w4fCrMKTLcOiE8OWWw==','w5bCksKDw58=','bkbCq8Og','HzFawrzDqMO6ccK4wrnCq8OVwp4=','YFrCszcaJHB6wqFJHsK/KHbDi8KSw5DDtEMxw4DCtnRg','w4LCkcOeZMKy','w5Rzw6LDqQNdMmbDisO/w6LCvgvCl8OAR8Ov','FMKhDlIdwprCkFDDuU3Cu8Kjwo
@dimdenGD
dimdenGD / discord_style.js
Last active November 5, 2018 17:55
Discord Style
var style = `/*! Generated by OPM*/@font-face{font-family:pixel-op;src:url(/font/pixeloperator.woff2) format("woff2"),url(/font/pixeloperator.woff) format("woff");font-weight:400;font-style:normal}::-webkit-scrollbar{width:16px;height:16px}::-webkit-scrollbar-corner{background-color:transparent}::-webkit-scrollbar-button{height:16px;width:16px;border:6px solid;border-image:url(http://i.piccy.info/i9/86cec70b30929137ea2483184b8873a9/1541164757/339/1273364/imgonline_com_ua_Transparent_backgr_ZFM5DXPhtC.png) 6 repeat;background-image:url(/img/gui.png);background-color:#aba389;border-width:6px;background-origin:border-box;background-repeat:no-repeat}::-webkit-scrollbar-button:hover{background-color:#b8b29c}::-webkit-scrollbar-button:active{background-color:#8d8671;border-image:url(http://i.piccy.info/i9/7136ba069868e4ce212c89a5770d1d59/1541167268/347/1273364/buttonpressed.png) 6 repeat}::-webkit-scrollbar-button:disabled{background-color:#8d8671;border-image:url(http://i.piccy.info/i9/7136ba069868e4ce212c89a5770d
@dimdenGD
dimdenGD / spooky_style.js
Last active November 5, 2018 17:47
OWOP Spooky Style
var style = `/*! Generated by OPM */@font-face{font-family:pixel-op;src:url(/font/pixeloperator.woff2) format("woff2"),url(/font/pixeloperator.woff) format("woff");font-weight:400;font-style:normal}::-webkit-scrollbar{width:16px;height:16px}::-webkit-scrollbar-corner{background-color:transparent}::-webkit-scrollbar-button{height:16px;width:16px;border:6px solid;border-image:url(/img/button.png) 6 repeat;background-image:url(/img/gui.png);background-color:#aba389;border-width:6px;background-origin:border-box;background-repeat:no-repeat}::-webkit-scrollbar-button:hover{background-color:#b8b29c}::-webkit-scrollbar-button:active{background-color:#8d8671;border-image:url(/img/button_pressed.png) 6 repeat}::-webkit-scrollbar-button:disabled{background-color:#8d8671;border-image:url(/img/button_pressed.png) 6 repeat}::-webkit-scrollbar-button:vertical:increment{background-position:-32px 0}::-webkit-scrollbar-button:vertical:increment:disabled{background-position:-48px 0}::-webkit-scrollbar-button:vertical:decrement{