Skip to content

Instantly share code, notes, and snippets.

View churchofthought's full-sized avatar
🪐
Universe simulations and whatnot.

Church of Thought churchofthought

🪐
Universe simulations and whatnot.
View GitHub Profile
@churchofthought
churchofthought / jagHook.asm
Created June 10, 2013 23:01
x86 Hooking Library written in MASM
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
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(
// 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 April 29, 2021 12:12
JS Hook (Coursera Playback Speed)
//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);
/* 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;
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
@churchofthought
churchofthought / delete-all-messages.js
Last active June 3, 2019 17:52 — forked from IMcPwn/delete-all-messages.js
Delete all messages in a Discord channel
// 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 / EulerDynamo3000.js
Created February 20, 2019 22:06
Euler Dynamo 3000
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 / gist:5202041
Last active October 23, 2017 13:25 — forked from anonymous/gist:5202029
Y Combinator Explained
I just finally had my mind snap into place with understanding of the Y Combinator. Most explanations I read, even the ones using JS, didn't make much sense and were overly long so here follows my own, much simpler explanation. I will be using JS.
We have fibonacci to start with, very simple recursive function.
It's fixed points are 0 and 1, fib(0) = 0, and fib(1) = 1
That's all a fix point means, when the f(x) == x
They are important because they are the only values at which recursion can cease.
Our Fibonacci Function
======================
@churchofthought
churchofthought / web3-gav.js
Created July 25, 2017 22:51 — forked from gavofyork/web3-gav.js
Gav's web3 alterations
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);