Skip to content

Instantly share code, notes, and snippets.

View Plutor's full-sized avatar
🗯️

Logan Ingalls Plutor

🗯️
View GitHub Profile
@Plutor
Plutor / discord-to-slack-bot.rb
Last active May 16, 2022 21:20 — forked from tomaszwro/discord-to-slack-bot.rb
Discord-to-Slack bot
require "discordrb"
require "httparty"
def notify_slack(message)
HTTParty.post(
# people_who_play_games
"https://hooks.slack.com/services/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
body: JSON.dump({
text: message,
username: "Discord announcement",
@Plutor
Plutor / Output
Created December 4, 2013 16:23 — forked from anonymous/Output
If your descendants alternated marrying someone completely of $ethnicity and someone not, they would approach 1/3 and 2/3 of that ethnicity. Re: <http://www.reddit.com/r/learnmath/comments/1s0vyx/what_is_the_fewest_number_of_generations_that_it/>
Generation 0: Parents 0.000% and 0% ethnic had a child 0.000% ethnic
Generation 1: Parents 0.000% and 100% ethnic had a child 50.000% ethnic
Generation 2: Parents 50.000% and 0% ethnic had a child 25.000% ethnic
Generation 3: Parents 25.000% and 100% ethnic had a child 62.500% ethnic
Generation 4: Parents 62.500% and 0% ethnic had a child 31.250% ethnic
Generation 5: Parents 31.250% and 100% ethnic had a child 65.625% ethnic
Generation 6: Parents 65.625% and 0% ethnic had a child 32.812% ethnic
Generation 7: Parents 32.812% and 100% ethnic had a child 66.406% ethnic
Generation 8: Parents 66.406% and 0% ethnic had a child 33.203% ethnic
Generation 9: Parents 33.203% and 100% ethnic had a child 66.602% ethnic
@Plutor
Plutor / for_switch_state_machine.cc
Last active December 15, 2015 19:29 — forked from anonymous/for-switch state machine
Pseudo-code of some code I'm refactoring. WTF.
bool for_switch_state_machine_wtf() {
int state = 1
for(;;) {
switch(state) {
case 1:
if (!do_some_stuff())
return false;
state = 2;