Skip to content

Instantly share code, notes, and snippets.

View pianomanfrazier's full-sized avatar

Pianomanfrazier pianomanfrazier

View GitHub Profile
@pianomanfrazier
pianomanfrazier / index.html
Created February 6, 2020 05:14
Fan out images
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 November 3, 2019 04:57
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 {
@pianomanfrazier
pianomanfrazier / starter.html
Last active September 6, 2019 22:14
html simple boiler plate
View starter.html
<html lang="en">
<head>
<title></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">
</head>
<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 April 20, 2019 15:43
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 January 10, 2019 21:22
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 January 2, 2019 00:57
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);