Skip to content

Instantly share code, notes, and snippets.

View ghostdevv's full-sized avatar
🍋
Well, when, life, gives, you, lemons;

Willow (GHOST) ghostdevv

🍋
Well, when, life, gives, you, lemons;
View GitHub Profile
@ghostdevv
ghostdevv / multiplication-assembly
Created November 17, 2020 15:57
Multiplication in Assembly Language (Little Man Computer - http://www.peterhigginson.co.uk/LMC/ )
// Get both numbers and store them
INP
STA NUM
INP
STA TIMES
// Multiplication Loop
LOOP LDA TOTAL
ADD NUM
STA TOTAL
LDA TIMES
@ghostdevv
ghostdevv / flexboxcorners.css
Created December 1, 2020 19:11
Flexbox corners (Some positioning with absolute)
*, *::before, *::after { box-sizing: border-box; }
.flexbox-corners {
background-color: DarkCyan;
width: 100%;
height: 100%;
display: flex;
justify-content:space-between;
position: relative;
}
@ghostdevv
ghostdevv / flexboxcorners.css
Created December 1, 2020 19:52
Flexbox corners
*, *::before, *::after { box-sizing: border-box; }
.flexbox-corners {
background-color: DarkCyan;
height: 100%;
display: flex;
flex-flow: row wrap;
justify-content: space-between;
}
@ghostdevv
ghostdevv / mkbackup.sh
Last active March 17, 2021 21:27
Auto mysql backup bash script
DIR="/backups"
BUCKET=""
CLUSTER=""
KEY=""
SECRET=""
USER="root"
PASSWORD=""
@ghostdevv
ghostdevv / mkbackup.sh
Last active May 15, 2023 17:04
Auto pterodactyl server backups
BACKUPSDIR="/var/lib/pterodactyl/backups"
BUCKET=""
CLUSTER=""
KEY=""
SECRET=""
NODE_NAME=""
FILE="$NODE_NAME-$(date +"%d-%m-%Y-at-%H-backup.tar.gz")"
@ghostdevv
ghostdevv / DISCORD.md
Last active May 13, 2021 21:53
Revert Discord Rebrand

So, you wanna reverse the rebrand? Well let's give it a go.

Here is the minified script, you can view the unminified version in the next file

function run(){GHOSTLog("Styles will be updated as best as possbile to before the rebrand");const n=document.createElement("style");n.innerHTML=GHOSTUpdatedStyles,document.body.appendChild(n),GHOSTLog("Let me know if there are any issues!")}function GHOSTLog(n){console.log(`%c${n}`,"color: #7289da; font-size: 20px; font-weight:600;")}GHOSTUpdatedStyles="\n:root {\n    --brand-experiment-100: #f8f9fd !important;\n    --brand-experiment-130: #f2f4fc !important;\n    --brand-experiment-160: #ebeefa !important;\n    --brand-experiment-200: #e3e7f8 !important;\n    --brand-experiment-230: #dae0f5 !important;\n    --brand-experiment-260: #d1d9f3 !important;\n    --brand-experiment-300: #c7d0f0 !important;\n    --brand-experiment-330: #b5c1ec !important;\n    --brand-experiment-360: #a5b3e7 !important;\n    --brand-experiment-400: #8ea1e1 !important;\n    --brand-e
@ghostdevv
ghostdevv / nimachan.md
Last active August 3, 2021 02:59
Nimachan
  1. Open discord console with ctrl + shift + i
  2. Click to console tab
  3. copy and paste the below script in

Script:

(()=>{const imageConfig={from:'https://cdn.discordapp.com/avatars/105280068598644736/a8d125774c2d58101b269acc27117362',to:'https://cdn.discordapp.com/attachments/757960538864091256/871398065871933490/Nimachan.png'};const change=()=>{console.log('Nimachan 3000 Running...');const images=()=>[...document.body.getElementsByTagName('img')].filter((i)=>i.src.startsWith(imageConfig.from)).map((image)=>(image.src=imageConfig.to));const text=()=>[...document.body.getElementsByTagName('span')].filter((span)=>span.innerHTML=='Nimajneb').map((span)=>(span.innerHTML='Nimachan'));text();images();console.log('Nimachan done')};setInterval(change,1000)})();

unminified:

@ghostdevv
ghostdevv / router-state.md
Last active August 17, 2021 19:58
Type safe state in a file based router

Type safe state in a file based router

Here is the golden question, imagine we have a file based routing solution and we want state. Say to pass down the database connection, or some auth guards to avoid the ../../... hell. Whatever it is it needs to be easy to use and type safe

Say we have this:

import Router from 'packge';

const router = new Router('src/routes');
@ghostdevv
ghostdevv / testing.md
Last active January 29, 2022 18:59
Testing zx

Hello

  1. First lets cd onto desktop
cd ~/Desktop
  1. Now lets create a folder called cheese and enter it
@ghostdevv
ghostdevv / readme.md
Created March 21, 2022 15:46
Convert any js project to rust in 0.1ms

The following command will change 'use strict' to 'use rust'!

find . -name "*.js" -type f ! -path "*/node_modules/*" -exec sed -i "s/'use strict'/'use rust'/g" {} +

Example

Before we have a slow, legacy js project