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 / 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 / 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);
@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
======================