Skip to content

Instantly share code, notes, and snippets.

View jsutch's full-sized avatar

Jeff Sutch jsutch

View GitHub Profile
@jsutch
jsutch / gist:4e32d61a52d20a52cfe906d71a2e5ee7
Created December 7, 2022 21:42
HHGTTG - Ford explains why the robots will win
“No,” said Ford firmly. “We must go to the party in order to drink a lot and dance with girls.”
“But haven’t you understood everything I …?”
“Yes,” said Ford, with a sudden and unexpected fierceness, “I’ve understood it all perfectly well. That’s why I want to have as many drinks and dance with as many girls as possible while there are still any left. If everything you’ve shown us is true…”
“True? Of course it’s true.”
“…then we don’t stand a whelk’s chance in a supernova.”
@jsutch
jsutch / BST tools in python
Last active May 4, 2020 19:19
BST tools in python
import random
class BSTNode(object):
def __init__(self, key):
self.val = key
self.left = None
self.right = None
# BST Methods
// Include standard I/O declarations
#include <stdio.h>
// Include string declarations
#include <string.h>// Program entry point
int main(int argc, char** argv) {
// Terminate if program is not run with three parameters.
if (argc != 4) {
// Print out the proper use of the program
puts("./a.out <size> <offset> <string>");
// Return failure
@jsutch
jsutch / tasting_notes.txt
Created July 10, 2019 23:02
Alcohol Tasting Notes
acetaldehyde (green apple aroma)
diacetyl (taste or aroma of buttery, butterscotch)
dimethyl sulfide (DMS) (taste or aroma of sweet corn, cooked veggies)
clove (spicy character reminiscent of cloves)
fruity / estery (flavour and aroma of bananas, strawberries, apples, or other fruit)
medicinal (chemical or phenolic character)
phenolic (flavour and aroma of medicine, plastic, Band-Aids, smoke, or cloves)
solvent (reminiscent of acetone or lacquer thinner)
sulfur (reminiscent of rotten eggs or burnt matches)
attrs = ['name', 'time', 'mainmob', 'room', 'experience', 'maxhps', 'maxmana', 'maxmoves', 'currenthps', 'currentmana', 'gold', 'bank', 'current_str', 'current_int', 'current_wis', 'current_dex', 'current_con', 'armor_on', 'clarity_on', 'sanctuary_on', 'regeneration_on', 'strength_on', 'senselife_on', 'infravision_on', 'kick_multiplier', 'kick_timer', 'harm_multiplier', 'harm_timer']
Raw output:
Amy 1554253429 tree1 6109 478772369 133073 10084 546 133073 8900 4508972 4000000 45 56 195 40 40 1 1 1 1 1 1 1 3 10 3 15
Basil 1554253429 tree3 6120 124484223 110445 10209 545 110445 8998 5869655 4000000 45 40 213 40 40 1 1 1 1 1 1 1 3 10 3 15
Bert 1554253432 tree3 6120 691951455 87643 10395 654 87643 8884 16488715 0 45 40 213 40 40 1 1 1 1 1 1 1 3 10 3 15
Bobby 1554253432 tree4 6123 632243881 74446 10244 674 74446 10050 21601039 0 49 40 176 40 58 1 1 1 1 1 1 1 3 10 3 15
Bruce 1554253432 tree4 6123 113532700 73164 8296 660 73164 8075 42395450 0 45 40 185 48 40 1 1 1 1 1 1 1 3 10 3 15
1554253409 tree3 6120 447985128

Keybase proof

I hereby claim:

  • I am jsutch on github.
  • I am jeffsutch (https://keybase.io/jeffsutch) on keybase.
  • I have a public key ASBDUYgTbz0lOCYHEtxbHPj9Rw1QByD3MQ21pddEcC8tMAo

To claim this, I am signing this object:

@jsutch
jsutch / server.py
Created May 17, 2016 00:29
New Test
# Assignment: Landing Page
# MandatoryDeadline: Monday of Week 4Difficulty Level: BasicEstimated Time: 1-2 hrs
# Create a flask project capable of handling the following routes:
# localhost:5000/ This route should serve a view file called index.html and display a greeting.
# localhost:5000/ninjas This route should serve a view file called ninjas.html and display information about ninjas.
# localhost:5000/dojos/new This route should serve a view file called dojos.html and have a form (don't worry where the form should be sent to - action=' ').
# Now create a folder inside of our project labeled static. Remember, this static folder will be used to serve all of our static content (stylesheets, images, javascript files, etc.)! Now try placing a stylesheet in the static folder and referencing it in our view files (templates).
from flask import Flask, render_template, url_for
127.0.0.1 - - [11/May/2016 16:38:13] "GET /success HTTP/1.1" 200 -
^C(venv) Shrdlu:new_environment person$ python hello1.py
* Running on http://127.0.0.1:5000/ (Press CTRL+C to quit)
* Restarting with stat
* Debugger is active!
* Debugger pin code: 128-550-458
127.0.0.1 - - [11/May/2016 16:39:27] "GET /success HTTP/1.1" 200 -
127.0.0.1 - - [11/May/2016 16:39:30] "GET /test HTTP/1.1" 200 -
127.0.0.1 - - [11/May/2016 16:40:28] "GET /test HTTP/1.1" 200 -
127.0.0.1 - - [11/May/2016 16:38:13] "GET /success HTTP/1.1" 200 -
^C(venv) Shrdlu:new_environment person$ python hello1.py
* Running on http://127.0.0.1:5000/ (Press CTRL+C to quit)
* Restarting with stat
* Debugger is active!
* Debugger pin code: 128-550-458
127.0.0.1 - - [11/May/2016 16:39:27] "GET /success HTTP/1.1" 200 -
127.0.0.1 - - [11/May/2016 16:39:30] "GET /test HTTP/1.1" 200 -
127.0.0.1 - - [11/May/2016 16:40:28] "GET /test HTTP/1.1" 200 -
from flask import Flask, render_template
app= Flask(__name__)
@app.route('/')
@app.route('/success')
@app.route('/test')
def hello_world():
return render_template('index.html')