Skip to content

Instantly share code, notes, and snippets.

@khornberg
khornberg / index.html
Created December 10, 2020 19:40
Knockout and Vue - it's "just" JavaScript :)
<html>
<head>
<script type='text/javascript' src='https://cdnjs.cloudflare.com/ajax/libs/knockout/3.5.0/knockout-min.js'></script>
<script src="https://cdn.jsdelivr.net/npm/vue@2/dist/vue.js"></script>
</head>
<body>
<p>
Demonstrates that knockout and vue and communicate data between the two frameworks
<br>
The data and shared functions are shown as pure javascript objects or functions
import graphlib
def ts_sort(topological_sorter):
topological_sorter.prepare()
spaces = 0
while topological_sorter:
nodes = topological_sorter.get_ready()
print(" "*spaces, nodes)
for node in nodes:
@khornberg
khornberg / example.py
Created October 27, 2022 17:57
Reading a CSV file
"""
More documenation about the csv moodule at https://docs.python.org/3/library/csv.html
"""
import csv
# the path to the file is relative to where you execute the python command
# both this file and the test.csv file should be in the same directory/folder
# you should run the command `python example.py` (without the backticks `) from the directory that contains example.py
with open('test.csv') as csvfile: