Skip to content

Instantly share code, notes, and snippets.

View 0x4007's full-sized avatar
🕶️
shadowy super pull request reviewing

アレクサンダー.eth 0x4007

🕶️
shadowy super pull request reviewing
View GitHub Profile
@0x4007
0x4007 / max-permissions.js
Created January 24, 2024 05:16
Max Permissions
document.querySelectorAll('.SelectMenu-item').forEach(item => {
if (item.textContent.includes('Read and write')) {
item.click();
}
});
// Sometimes you might need to trigger a change event for the clicks to take effect
// This part is optional and depends on how GitHub's front-end is implemented
document.querySelectorAll('input[type=radio]').forEach(radio => {
if (radio.value === 'write') {
@0x4007
0x4007 / special-gfm.md
Created December 23, 2023 19:02
Special GFM

Note

test

Warning

test

Tip

test

@0x4007
0x4007 / ethereum-keygen.sh
Last active August 9, 2023 18:17
For dApp development, its common for scripts to use `PRIVATE_KEY` and `PUBLIC_KEY` so for security reasons I automatically generate a temporary (but valid) keypair. I load this in with my `.bashrc`. Type in `keygen` to automatically generate a new keypair and assign to their respective variable names.
#!/bin/bash env
keygen() {
PREFIX="$HOME/.evm/"
KEY="$(echo "$PREFIX")key"
PUB="$(echo "$PREFIX")pub"
PRIV="$(echo "$PREFIX")priv"
ADDRESS="$(echo "$PREFIX")address"
@0x4007
0x4007 / auto-install.js
Created January 29, 2023 22:58
This helped me to setup puppeteer on my VPS. It kept throwing OS missing dependency errors, so this will parse the error and automatically install it.
const { execSync } = require('child_process');
function runYarn() {
// Run yarn ci command
try {
execSync('yarn ci');
console.log('yarn ci ran successfully');
} catch (err) {
// Extract the error message
const errorMessage = err.stderr.toString();
@0x4007
0x4007 / discord-server-management-tools.js
Created October 5, 2022 11:39
Made some tools to help mass delete Discord servers off of my account
(function scrapeServers() {
const servers = document.querySelectorAll(`[data-list-item-id^="guildsnav___"]`);
// console.log(servers);
const database = {};
servers.forEach(server => {
const guildsnav = server.getAttribute(`data-list-item-id`);
const serverId = guildsnav.match(/\d+$/igm)?.pop();
if (!serverId) { return }
@0x4007
0x4007 / clear-evidence.sh
Created September 23, 2022 12:54
Rip a file out of git history
git filter-branch -f --index-filter 'git rm --cached --ignore-unmatch *.sql'
javascript:(function () {
const id = "inDomConsole";
if (document.getElementById(id) === undefined) return;
const consoleElement = document.createElement("details");
consoleElement.id = id;
const scopedStyle = document.createElement("style");
const container = document.createElement("div");
scopedStyle.textContent = `
#${id} {
@0x4007
0x4007 / tac automate.js
Created October 6, 2020 06:28
automate clicking 0 amount approval after doing one manually on https://tac.dappstar.io/
const buffer = [];
function queue(e) {
buffer.push(e);
}
document.querySelectorAll(
`#root >
div >
div >
table >
git diff --summary | grep --color 'mode change 100755 => 100644' | cut -d' ' -f7- | xargs chmod +x
git diff --summary | grep --color 'mode change 100644 => 100755' | cut -d' ' -f7- | xargs chmod -x
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.34.0/install.sh | bash
. ~/.nvm/nvm.sh
nvm install node
node -e "console.log('Running Node.js ' + process.version)"