Skip to content

Instantly share code, notes, and snippets.

View PistolRcks's full-sized avatar

Peter Arnold PistolRcks

View GitHub Profile
@PistolRcks
PistolRcks / README.md
Last active September 25, 2020 01:36
Bisection Method in Python 3.8

Bisection Method in Python 3.8

This is the Bisection Method made in Python 3.8! This, along with most of the math scripts I've made, was fun to do. I feel like I screwed something up in this implementation. Let me know if you find a bug. Edit the function f(x) to solve it. You can adjust the initial interval by inputting a list with size of 2.

Of course, this also comes with the stipulations of the MIT License. You are free to distribute/edit/whatever in line with the MIT License!

@PistolRcks
PistolRcks / masscast.py
Created May 20, 2020 03:31
Masscast - A silly little Python script to play a certain Youtube video on all available Chromecasts on a network
# Cast something to ALL AVAILABLE DEVICES ON A NETWORK!
# By PistolRcks
# All downloads and reuse of this file IN ANY WAY MUST retain the first three lines, and properly attribute me (just as "PistolRcks", preferrably with a link to my Github) in the credits of whatever thing you may use it in. Otherwise, go nuts, and I take ABSOLUTELY NO RESPONSIBILITY for whatever you make with this. YOU HAVE BEEN WARNED.
import pychromecast as pycc
from pychromecast.controllers.youtube import YouTubeController
import sys
import time
link = sys.argv[1]
@PistolRcks
PistolRcks / README.md
Last active November 6, 2019 00:03
A Python implementation of the Flow Augmentation Algorithm

The Flow Augmentation Algorithm in Python

For the math major who doesn't want to do their work

It's a reimplementation of my Discrete Math book's flow augmentation algorithm. It takes in an adjacency matrix with flows and capacities at intersections (see the example) and returns an adjacency matrix with the maximum flow.

Caveat Emptor

It should only freak out whenever you don't put in a valid transportation network as an adjacency matrix. There is currently no way to check for this in the script (and there probably never will be).

Licensing???

As for if you use this in any of your projects, please attribute me (linking my Github Profile in a LICENSES.md or merely in a comment line at the beginning of the code, just SOMEWHERE in your project where it may be visible) in any use case (standalone, with edits, in another work, etc.)! Please keep the first two commented lines intact as well.

@PistolRcks
PistolRcks / README.md
Last active November 5, 2019 23:55
A python script to bruteforce the Knapsack Problem

The Knapsack Problem Bruteforcer

For the math major of distinction

Bruteforces the Knapsack Problem. 'Nuff said.

There are a few problems with neatness in the escape sequences, but to be honest, I'm not quite so sure how they work either! Anyone with more experience will—I'm sure—be happy to correct me if they are being used incorrectly. For example, long lists of items may break the escape sequences.

Another problem for some is that the function doesn't return the optimal knapsack. It shouldn't be that hard to adapt.

@PistolRcks
PistolRcks / README.md
Last active February 6, 2022 11:28
Cyberpunk 2020 Custom Google Sheets Functions for Combat

This is just a nice diceroller used to save time during combat that I made for my tabletop RPG group--probably unnecessarily. Everything should be pretty self explanatory, but not optimized. Also, stopping power for each body part should be put in B4:B9 because I'm too lazy to make that editable. Let me know if any of this isn't properly implemented according to the ruleset!