Skip to content

Instantly share code, notes, and snippets.

Avatar
🪐
Universe simulations and whatnot.

Church of Thought churchofthought

🪐
Universe simulations and whatnot.
View GitHub Profile
View lazy multidimensional iterator.js
// write iterator class MyIterator(input)
// that has hasNext(), and next(), and can appropriately deal with multidimensional arrays
class MyIterator {
#stack
#cachedNext
#hasNext = false
constructor(input){
@churchofthought
churchofthought / hook.js
Created Apr 29, 2021
JS Hook (Coursera Playback Speed)
View hook.js
//webpack:///./static/bundles/video-experimental/constants.js
//webpack:///./static/bundles/video-experimental/components/settingsMenu/VideoSettingsMenu.jsx
const speeds = [];
const playbackDelta = 0.250001;
for (let i = 0.75; i <= 10; i += playbackDelta)
speeds.push(i);
View level15.c
/* WARNING: Function: __x86.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */
void main(undefined4 param_1,undefined4 param_2)
{
__uid_t __euid;
__uid_t __ruid;
__gid_t __egid;
__gid_t __rgid;
View dumbbell daily workout routine
100% Dumbbell Driven 8-Day Split ( My Routine)
Day 1 - Upper Back (Lats) and Biceps
4 sets Dumbbell Floor Rows, on one knee, other leg is somewhat relaxed
be careful of hamstring strain - your other arm and leg will be supporting all the rowing weight
be careful of hernias - do not spread your legs too far apart - the groin should be engaged as little as possible.
4 sets Dumbbell Curls - ending with eccentrics, slowly let weight fall as bicep fails on last rep
Day 2 - Rest
View parallelMap_parallelDo.js
const parallelMap = async (arr, f, n = Infinity, inPlace = false) => {
const results = inPlace ? arr : Array(arr.length)
const entries = arr.entries()
const worker = async () => {
for (const [key, val] of entries)
results[key] = await f(val, key)
}
await Promise.all(
View EulerDynamo3000.js
const Discord = require("discord.js")
const config = require("./config.json")
const fs = require("fs")
const timeout = ms => new Promise(res => setTimeout(res, ms))
const client = new Discord.Client({autoReconnect: true, sync: true});
(async () => {
await client.login(config.token)
@churchofthought
churchofthought / delete-all-messages.js
Last active Jun 3, 2019 — forked from CarletonStuberg/delete-all-messages.js
Delete all messages in a Discord channel
View delete-all-messages.js
// Turn on Developer Mode under User Settings > Appearance > Developer Mode (at the bottom)
// Then open the channel you wish to delete all of the messages (could be a DM) and click the three dots on the far right.
// Click "Copy ID" and paste that instead of LAST_MESSAGE_ID.
// Copy / paste the below script into the JavaScript console.
// If you're in a DM you will receive a 403 error for every message the other user sent (you don't have permission to delete their messages).
var before = '574417506572435467';
clearMessages = function(){
const authToken = document.body.appendChild(document.createElement`iframe`).contentWindow.localStorage.token.replace(/"/g, "");
const channel = window.location.href.split('/').pop();
@churchofthought
churchofthought / web3-gav.js
Created Jul 25, 2017 — forked from gavofyork/web3-gav.js
Gav's web3 alterations
View web3-gav.js
import SolidityFunction from 'web3/lib/web3/function';
import Web3 from 'web3';
var isManaged = typeof(window.web3) == "object";
export var web3 = isManaged ? window.web3 : new Web3(new Web3.providers.HttpProvider("http://localhost:8545"));
if (web3.eth.accounts.indexOf(web3.eth.defaultAccount) == -1) {
var best = 0;
web3.eth.accounts.forEach(function(a) {
var b = +web3.eth.getBalance(a);
@churchofthought
churchofthought / gist:5753292
Created Jun 10, 2013
x86 hooking/detours macros and procedures written in MASM
View gist:5753292
comment *==========================================
jagHook
Note that:
macros are like win32 api; they may modify all registers but ebx, edi, esi
your .text section needs to be writable if using the non-procedural hooking
if using radasm, add /SECTION:.text|RWE the LINK box under Project -> Project Options]
otherwise, just add /SECTION:.text,RWE to linking arguments
@churchofthought
churchofthought / jagHook.asm
Created Jun 10, 2013
x86 Hooking Library written in MASM
View jagHook.asm
comment *==========================================
jagHook by jAgx
Note that:
macros are like win32 api; they may modify all registers but ebx, edi, esi
your .text section needs to be writable if using the non-procedural hooking
if using radasm, add /SECTION:.text|RWE the LINK box under Project -> Project Options]
otherwise, just add /SECTION:.text,RWE to linking arguments