>
Just an example page for testing
This is the number pi, . It is the ratio of a circles circumference to its diameter.
This is the quadratic formula. It allows the calculation of roots to quadratic polynomials:
For example, here is a function that generates adds each post or page to the rss feed of this website. Currently it only adds markdown files and not premade html files so this needs to be changed. To see the full script which generates this site look here. Its rather ugly and inefficient at the moment but it does the trick.
#!/usr/bin/python3
import os, re, time, yaml, sys
="<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<rss version=\"2.0\">\n\t<channel>"...
rssdef yaml_rss(fpath,mtime,slug):
global rss
with open(fpath, encoding='UTF-8') as f:
= list(yaml.load_all(get_yaml(f), Loader=yaml.SafeLoader))
config = f.read()
text #print(text) print("CONFIG from", f)print("TEXT from", f)
if 'title' in config[0]: # Add items to rss feed
+="\n\t\t<item>\n\t\t\t<title>"+config[0]["title"]+"</title>"
rssif 'description' in config[0]:
+="\n\t\t\t<description>"+config[0]["description"]+"</description>"
rsselse:
+="\n\t\t\t<description>None</description>"
rss+="\n\t\t\t<link>"+slug+"</link>\n\t\t\t<guid isPermaLink=\"false\">"+slug+"</guid>\n\t\t\t<pubDate>"+mtime+"</pubDate>\n\t\t</item>" rss
#include <stdio.h>
int main() {
"hello");
printf(return 0;
}
let w = 400,h = 200, amt = 0.1;
let x=0,y=0,choice=[0.05,0.06,0.07,0.08,0.04]
function setup() {
= createCanvas(w, h);
cnv .parent('cnv');
cnvnoStroke();
= mouseX;
prevMouseX = mouseY;
prevMouseY
}function draw() {
background("#fffee0");
smooth();
push();
translate(w / 2, h / 3);
for (let i = 100; i >=20; i--){
strokeWeight(3);
stroke(255%i,180,180);
noFill();
smooth();
if(x<mouseX)x+=random(choice);
if(x>mouseX)x-=random(choice);
if(y<mouseY)y+=random(choice);
if(y>mouseY)y-=random(choice);
let xp=map(lerp(currX,x,1),0,w,-amt,amt);
let yp=map(lerp(currY,y,1),0,w,-amt,amt);
translate(xp,yp);
ellipse(0,0,i,i);
}eyeball(20);
pop();
}function eyeball(s){
fill(0);
ellipse(0,0,s,s);
fill(255);
ellipse(0, 0, s, map(sin(noise(frameCount/40)), -1, 1, 0,s));
fill(0);
push()
translate(map(mouseX, 0, w, -1, 1), map(mouseY, 0, w, -1, 1))
ellipse(0,0,s/4,s/4);
pop()
}
Last edited :- Sat, 09 Apr 2022 19:08:29 BST