Skip to content

Instantly share code, notes, and snippets.

View ajmeese7's full-sized avatar
๐Ÿ™Š

Aaron Meese ajmeese7

๐Ÿ™Š
View GitHub Profile
// Set console.log to log to a file, for easy debugging of large amounts of data;
// https://stackoverflow.com/a/33898010/6456163
const fs = require('fs');
const util = require('util');
const logFile = fs.createWriteStream('console.log', { flags: 'w' });
var logStdout = process.stdout;
console.log = function () {
logFile.write(util.format.apply(null, arguments) + '\n');
logStdout.write(util.format.apply(null, arguments) + '\n');
}
did:3:kjzl6cwe1jw1496p6mu2si9t1s6q1uyyez90t4irl7l2hng5rpfh3prchm18xk2
@ajmeese7
ajmeese7 / index.css
Created March 23, 2022 19:45
Static animation in CSS
@keyframes static {
0% {
transform: translateX(-1000px);
}
33% {
transform: translateY(-1000px);
}
66% {
@ajmeese7
ajmeese7 / iFrame.js
Created April 25, 2022 19:33
Pass stringified functions to iFrame and use them
/** Modified from https://stackoverflow.com/a/26917987/6456163 */
String.prototype.parseFunction = function () {
/** Removes inline comments, courtesy of https://www.regextester.com/93742 */
const strippedOfComments = this.replace(/[^:]\/\/.*/g, '');
const funcReg = /function *\(([^()]*)\)[ \n\t]*{(.*)}/gmi;
const match = funcReg.exec(strippedOfComments.replace(/(\n|\t)/g, ''));
// If the passed string is somehow not a function
if (!match) return null;
@ajmeese7
ajmeese7 / getProxyList.sh
Created April 30, 2022 20:02
Use Guzzle proxy in PHP
curl https://raw.githubusercontent.com/TheSpeedX/SOCKS-List/master/http.txt -o proxyList.txt
@ajmeese7
ajmeese7 / reset.sh
Created May 12, 2022 22:36
Hard reset a git repo
#!/bin/bash
git fetch --all
git reset --hard origin/master
@ajmeese7
ajmeese7 / fake-cat.sh
Last active May 17, 2022 00:08
Allows the contents of a file to be viewed without any fancy commands like `cat` or `less`, it only requires `echo`
alias cat='_cat(){ echo "$(<$1)";}; _cat'
@ajmeese7
ajmeese7 / install-rtl8188eu-on-zorin-os.sh
Created May 17, 2022 00:42
Guide from Zorin OS support on how to update to the latest wifi drivers
sudo apt-get update
sudo apt-get install make gcc linux-headers-$(uname -r) build-essential git dkms
git clone https://github.com/lwfinger/rtl8188eu.git
cd rtl8188eu
make all
sudo make install
@ajmeese7
ajmeese7 / base_url.js
Created May 24, 2022 01:14
Gets the root of a domain from a URL in JavaScript
const baseURL = (url) => url.split("//")[1].split("/")[0];
@ajmeese7
ajmeese7 / dotenv.sh
Created June 9, 2022 18:31
Used to source `.env` files in Bash to be used as variables.
#!/bin/bash
export $(sed 's/#.*//g' .env | xargs)