Skip to content

Instantly share code, notes, and snippets.

View mouse-reeve's full-sized avatar

Mouse Reeve mouse-reeve

View GitHub Profile
@mouse-reeve
mouse-reeve / fizzbuzz.py
Last active April 22, 2022 06:33
Fizzbuzz via answers.com
''' we're solving fizzbuzz with a little help from the web '''
from html.parser import HTMLParser
from urllib.request import Request, urlopen
import re
import time
base_url = 'https://www.answers.com/Q/'
tag_name = 'div'
class_name = 'answer-body'
delimiter = '_'
@mouse-reeve
mouse-reeve / witches_pi.py
Last active February 28, 2018 20:04
Once Upon a Pi
#!/usr/bin/env python
''' via https://github.com/whoshuu/Projects/blob/master/Numbers/pi.py '''
import math
def once_upon_a_time(and_, in_a_village):
there_was_a_witch = 10 ** 16
who_hid_her_true_nature = float((and_ * there_was_a_witch) // in_a_village) / \
there_was_a_witch
and_the_birds = (int(there_was_a_witch * math.sqrt(who_hid_her_true_nature)) * in_a_village) // \
there_was_a_witch
@mouse-reeve
mouse-reeve / index.html
Created June 13, 2017 06:04
Scone recipe distances
<!DOCTYPE html>
<meta charset="utf-8">
<style>
.node {
stroke: #fff;
stroke-width: 1.5px;
}
.link {
Verifying that +mousereeve is my blockchain ID. https://onename.com/mousereeve

Keybase proof

I hereby claim:

  • I am mouse-reeve on github.
  • I am mouse (https://keybase.io/mouse) on keybase.
  • I have a public key whose fingerprint is 0F2D 7751 AA7F 7F03 12AA 4B6A CD9A 922F EF10 CB25

To claim this, I am signing this object:

@mouse-reeve
mouse-reeve / toNegativeBase
Created May 27, 2014 05:25
Converts a number to a negative base (between -2 and -10). Negadecimal, for example, or negabinary. http://en.wikipedia.org/wiki/Negative_base
function toNegativeBase(number, radix) {
if (radix > -2 || radix < -10) {
throw 'invalid radix';
}
var result = 0;
while (number != 0) {
var exp = number > 0 ? 0 : 1;
var sum = 0;