Skip to content

Instantly share code, notes, and snippets.

View davegotz's full-sized avatar

David Gotz davegotz

View GitHub Profile
@davegotz
davegotz / index.html
Last active January 12, 2022 01:59
Simple Example of D3 Axes
<html>
<head>
<title>Simple Example of D3 Axes</title>
<script src="https://d3js.org/d3.v7.min.js"></script>
<style>
/* Style information for axis labels */
.axis-label {
font-family: sans-serif;
font-size: 12px;
}
@davegotz
davegotz / hello_world.py
Created December 20, 2020 15:25
Testing gist functionality from within pycharm
print("Hello, World!")
__author__ = 'David Gotz, gotz@unc.edu, Onyen = gotz'
from flask import Flask
from flask import request
# Create the web application object.
app = Flask(__name__)
# Define the web pages.
@app.route("/index.html")
__author__ = 'David Gotz, gotz@unc.edu, Onyen = gotz'
from flask import Flask
app = Flask(__name__)
@app.route("/hello")
@app.route("/")
def hello():
__author__ = 'David Gotz, gotz@unc.edu, Onyen = gotz'
from flask import Flask
from flask import request
def create_web_app():
app = Flask(__name__)
# Open tweet data from http://www.trumptwitterarchive.com/archive
__author__ = 'David Gotz, gotz@unc.edu, Onyen = gotz'
import random
def partition_list(num_list, start, end):
# The pivot is the last item in the section of the list we are sorting.
pivot_value = num_list[end-1]
# The "wall" position divides our "smaller section" from the rest of the list. Everything to the
class Tower:
def __init__(self):
self.discs = []
def add_disc(self, disc_to_add):
self.discs.append(disc_to_add)
def remove_disc(self):
return self.discs.pop()
class Tower:
def __init__(self):
self.discs = []
def add_disc(self, disc_to_add):
self.discs.append(disc_to_add)
def remove_disc(self):
return self.discs.pop()
__author__ = 'David Gotz, gotz@unc.edu, Onyen = gotz'
# A City has a name and a set of departing routes
class City:
def __init__(self, city_name):
self.city_name = city_name
self.routes = []
def add_departure(self, route):
import random
class Shape:
def __init__(self, shape_name, shape_width, shape_symbol):
self.name = shape_name
self.width = shape_width
self.symbol = shape_symbol
def __str__(self):
return self.name + " of size " + str(self.width) + " and area " + str(self.area())