Skip to content

Instantly share code, notes, and snippets.

Avatar

Pianomanfrazier pianomanfrazier

View GitHub Profile
View index.html
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width" />
<link rel="stylesheet" href="style.css" type="text/css">
<title>Worksheets</title>
</head>
<body>
<div id="images"></div>
@pianomanfrazier
pianomanfrazier / sierpinsky.rs
Created Nov 3, 2019
Sierpinsky triangles in Rust using Nannou
View sierpinsky.rs
use nannou::prelude::*;
fn main() {
nannou::app(model).update(update).run();
}
struct Triangle {
top: Point2<f32>,
left: Point2<f32>,
right: Point2<f32>,
View fixed-column-table.html
<html lang="en">
<head>
<title>Fancy HTML Table</title>
<meta http-equiv="x-ua-compatible" content="ie=edge">
<meta charset="utf-8">
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale = 1.0, maximum-scale=1.0, user-scalable=no">
<link rel="stylesheet" href="main.css">
<style>
body {
View tic-tac-toe.p5.js
let w = 150; // width/height of the square
let grid = [
['','',''],
['','',''],
['','','']
]
let players = ['X','O']
let game_over = false;
let turn = 0;
View input.md
title: "Example Pandoc input file"
author: Ryan Frazier
date: June 9, 2019
mainfont: Lora
fontsize: 12pt
linkcolor: red
toc: true
geometry: "left=3cm,right=3cm,top=2cm,bottom=3cm"
---
View _index.md

+++ paginate_by = 2 sort_by = "date" +++

@pianomanfrazier
pianomanfrazier / typography_test.js
Last active Apr 20, 2019
The output of Typography JS after applying a theme
View typography_test.js
const Typography = require('typography');
const theme = require('typography-theme-lincoln');
const typography = new Typography(theme);
console.log(typography.toString())
@pianomanfrazier
pianomanfrazier / check_escaped_utf8.py
Created Jan 10, 2019
The product export from the database had mangled characters in it. This function grabs all the decimal encoded characters and writes it to an html file for inspection.
View check_escaped_utf8.py
import xml.etree.ElementTree as ET
import html
def inspect_escape_characters():
filename = "products.xml"
print(f'XML file: {filename}')
tree = ET.parse(filename)
root = tree.getroot()
all_descriptions = []
count = 0
@pianomanfrazier
pianomanfrazier / references.fs
Created Jan 2, 2019
Playing around with Rust ownership
View references.fs
fn main() {
let x = String::from("hello"); // allocate from the heap
let mut y = x;
// let mut y = x.clone(); // clone if you want to use x again
y.push_str(", world! ");
append(&mut y);
print(&y);
append(&mut y);
print(&y);
@pianomanfrazier
pianomanfrazier / fact.rs
Last active Jan 1, 2019
A factorial test in Rust
View fact.rs
use std::cmp::Ordering;
use std::io;
const ONE: u64 = 1;
fn main() {
loop {
let mut guess = String::new();
io::stdin()