Skip to content

Instantly share code, notes, and snippets.

View flleeppyy's full-sized avatar
💭
aaaaaaaaaaaaaaaaaaaaa

Chen Marisa flleeppyy

💭
aaaaaaaaaaaaaaaaaaaaa
View GitHub Profile
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
</head>
<body>
@flleeppyy
flleeppyy / organizedSqlite3Results.js
Created November 20, 2020 20:45
sqlite3 multiple rows to a more formatted object.
/// PLEASE NOTE THIS WORKS ONLY FOR TABLES WITH 2 COLUMNS
/**
* Lets say you have a database table that has some settings for a web application,
* that has two columns: option, and value, and you need to retrieve those settings.
* The way node-sqlite3 returns them is like the following
* QUERY: SELECT * FROM users WHERE option IN ('servername', 'serveradmincontact', 'loginenabled')
**/
results = [
{ option: 'servername', value: 'BlogApp' },

Keybase proof

I hereby claim:

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

To claim this, I am signing this object:

// Input a number and it will format like so, trimming where neccesary
// HH:MM:SS
// 1:12
// 12:42
// 1:34:15
// 10:00:01
// etc
function convertHMS(time) {
let hours = Math.floor(time / 3600);
@flleeppyy
flleeppyy / express.d.ts
Last active May 9, 2021 01:16
Random RSA generation
declare global {
namespace Express{
interface Application {
rsa: {
passphrase: string;
privateKey?: string;
publicKey?: string;
}
}
}
@flleeppyy
flleeppyy / loopOverShadowroot.js
Created May 12, 2021 19:46
Loop over shadow root/children and unhide things
// Pass an array of children from an element
// for example: loopOver($("os-settings-ui").shadowRoot.children)
function loopOver(aaaa) {
let elemsWeShouldLoopOver = Array.from(aaaa)
elemsWeShouldLoopOver.forEach(e => {
if (e.hidden == true) { e.hidden = false }
if (e.shadowRoot !== null) { return loopOver(Array.from(e.shadowRoot.children)) }
if (e.children.length > 1) { return loopOver(Array.from(e.children)) }
})
}
@flleeppyy
flleeppyy / getLatest.js
Last active August 5, 2021 16:08
Get latest version from array of versions formatted like so: x.x.x
function getLatest(arr) {
if (arr.length === 0) {
return null;
}
if (arr.length === 1) {
return arr[0];
}
const newArr = arr.map(item => {
return parseInt(item.split(".").join(""));
});
@flleeppyy
flleeppyy / worm.js
Last active August 16, 2021 04:16
worm golf
// It started from a message in my Discord server
// https://i.imgur.com/HdA29Gc.png
// https://cdn.discordapp.com/emojis/862785811673907221.gif?v=1
// Then i was like "hey im gonna make a javascript script of this that does that worm thing"
const a = [")", "|", "(", "|"];
let b = 0;
const wormtime = 100; // how often the worm wiggles
function worm() {
@flleeppyy
flleeppyy / discord_removecustomactivity.css
Last active August 17, 2021 01:52
Discord - Remove status indicators
/*Remove custom statuses*/
.activity-525YDR,
.activity-2Gy-9S,
.customStatusActivity-nmH3DF,
.customStatus-oN4ZZY {
display: none
}
@flleeppyy
flleeppyy / start.sh
Created April 7, 2022 19:43
JMusicBot configuration
nohup java -Dnogui=true -jar JMusicBot-0.3.8.jar &