From e9f60921952083dea91439cef7804c8b023935af Mon Sep 17 00:00:00 2001 From: hannahilea Date: Thu, 28 Mar 2024 17:02:49 -0400 Subject: [PATCH 1/8] wip --- projects/__template/index.html | 43 +++++++++++++++++++++++++++++ projects/__template/sketch.js | 33 ++++++++++++++++++++++ projects/wonderful-world/index.html | 43 +++++++++++++++++++++++++++++ projects/wonderful-world/sketch.js | 33 ++++++++++++++++++++++ utilities.jl | 21 ++++++++++++++ 5 files changed, 173 insertions(+) create mode 100644 projects/__template/index.html create mode 100644 projects/__template/sketch.js create mode 100644 projects/wonderful-world/index.html create mode 100644 projects/wonderful-world/sketch.js create mode 100644 utilities.jl diff --git a/projects/__template/index.html b/projects/__template/index.html new file mode 100644 index 0000000..ed9b073 --- /dev/null +++ b/projects/__template/index.html @@ -0,0 +1,43 @@ + + + + + Sketch: {{ PROJECT_NAME }} + + + + + + + + + + +
+

@hannahilea > projects > Sketch: {{ PROJECT_NAME }} +

+
+ +
+ Details +

A creative coding excercise (prompt: TODO), co-created with TODO + while at the Recurse Center

+

Usage: When prompted, grant microphone access, then TODO.

+
+ + + + + + diff --git a/projects/__template/sketch.js b/projects/__template/sketch.js new file mode 100644 index 0000000..4a1fa66 --- /dev/null +++ b/projects/__template/sketch.js @@ -0,0 +1,33 @@ +// TODO: edit this blurb! +// Original p5 sketch {{ co-created with FOO+link}} +// as a creative coding project while at the +// Recurse Center (www.recurse.com/) + +let mic; + +const params = { + micSensitivity: 4.0, +}; + +const gui = new GUI(); +gui.add(params, 'micSensitivity', 0.01, 30, 2); + +function setup() { + createCanvas(windowWidth, windowHeight) + + // Create an Audio input + mic = new p5.AudioIn(); + + // start the Audio Input. + // By default, it does not .connect() (to the computer speakers) + mic.start(); +} + +function windowResized() { + resizeCanvas(windowWidth, windowHeight); +} + +function draw() { + // https://stackoverflow.com/questions/55026293/google-chrome-javascript-issue-in-getting-user-audio-the-audiocontext-was-not + getAudioContext().resume(); +} diff --git a/projects/wonderful-world/index.html b/projects/wonderful-world/index.html new file mode 100644 index 0000000..13583c4 --- /dev/null +++ b/projects/wonderful-world/index.html @@ -0,0 +1,43 @@ + + + + + Sketch: Wonderful world + + + + + + + + + + +
+

@hannahilea > projects > Sketch: Wonderful world +

+
+ +
+ Details +

A creative coding excercise (prompt: TODO), co-created with TODO + while at the Recurse Center

+

Usage: When prompted, grant microphone access, then TODO.

+
+ + + + + + diff --git a/projects/wonderful-world/sketch.js b/projects/wonderful-world/sketch.js new file mode 100644 index 0000000..4a1fa66 --- /dev/null +++ b/projects/wonderful-world/sketch.js @@ -0,0 +1,33 @@ +// TODO: edit this blurb! +// Original p5 sketch {{ co-created with FOO+link}} +// as a creative coding project while at the +// Recurse Center (www.recurse.com/) + +let mic; + +const params = { + micSensitivity: 4.0, +}; + +const gui = new GUI(); +gui.add(params, 'micSensitivity', 0.01, 30, 2); + +function setup() { + createCanvas(windowWidth, windowHeight) + + // Create an Audio input + mic = new p5.AudioIn(); + + // start the Audio Input. + // By default, it does not .connect() (to the computer speakers) + mic.start(); +} + +function windowResized() { + resizeCanvas(windowWidth, windowHeight); +} + +function draw() { + // https://stackoverflow.com/questions/55026293/google-chrome-javascript-issue-in-getting-user-audio-the-audiocontext-was-not + getAudioContext().resume(); +} diff --git a/utilities.jl b/utilities.jl new file mode 100644 index 0000000..804f28e --- /dev/null +++ b/utilities.jl @@ -0,0 +1,21 @@ +# Some quick and brittle Julia utilities for adding new projects +# Doesn't handle nested, only does new js projects +# Will fail if dir already exists +function new_js_project() + project_name = lstrip(rstrip(Base.prompt("Enter project name: "))) + dir_name = lstrip(rstrip(Base.prompt("Enter project url name: "))) + dir = joinpath("projects", dir_name) + + @info "Creating new project directory" project_name dir_name + cp(joinpath("projects", "__template"), dir) + for file in readdir(dir; join=true) + @info "Updating $file..." + str = read(file, String) + str = replace(str, "{{ PROJECT_NAME }}" => project_name) + str = replace(str, "{{ DIR_NAME }}" => dir_name) + write(file, str) + end + + # TODO: update projects index!! + +end From eb617440471888cb9f3235a1e08f378fc40c14ee Mon Sep 17 00:00:00 2001 From: hannahilea Date: Mon, 1 Apr 2024 13:11:05 -0400 Subject: [PATCH 2/8] format --- projects.html | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/projects.html b/projects.html index 0e698cf..bdcdb37 100644 --- a/projects.html +++ b/projects.html @@ -33,18 +33,22 @@

@hannahilea's projects

(SITE IS UNDER ACTIVE DEVELOPMENT; ADDITIONAL PROJECTS COMING SOON) - +
From a64e0f0078e0571846a53c09921d84d1aaec1e14 Mon Sep 17 00:00:00 2001 From: hannahilea Date: Mon, 1 Apr 2024 13:45:10 -0400 Subject: [PATCH 3/8] add templated project adding to project index --- projects.html | 19 ++++++++++++------- utilities.jl | 17 +++++++++++++++-- 2 files changed, 27 insertions(+), 9 deletions(-) diff --git a/projects.html b/projects.html index bdcdb37..283e2fa 100644 --- a/projects.html +++ b/projects.html @@ -29,15 +29,13 @@

@hannahilea's projects

- (SITE IS UNDER ACTIVE DEVELOPMENT; ADDITIONAL PROJECTS COMING SOON)
diff --git a/utilities.jl b/utilities.jl index 804f28e..3ada255 100644 --- a/utilities.jl +++ b/utilities.jl @@ -1,6 +1,10 @@ +const NEW_PROJ_COMMENT = "" + # Some quick and brittle Julia utilities for adding new projects # Doesn't handle nested, only does new js projects # Will fail if dir already exists +# TODO: function to add different types of projects +# TODO: validate git state isn't dirty before starting function new_js_project() project_name = lstrip(rstrip(Base.prompt("Enter project name: "))) dir_name = lstrip(rstrip(Base.prompt("Enter project url name: "))) @@ -16,6 +20,15 @@ function new_js_project() write(file, str) end - # TODO: update projects index!! - + @info "Adding new project to project index" + let + projects_file = "projects.html" + new_blob = """\n
  • \n

    $(project_name)

    \n
    \n

    TODO-description

    \n
  • """ + str = read(projects_file, String) + i = findfirst(NEW_PROJ_COMMENT, file) + isnothing(i) && throw(ArgumentError("Oh no, $(NEW_PROJ_COMMENT) not found in projects.html!")) + str = str[1:last(i)] * new_blob * str[last(i)+1:end] + write(projects_file, str) + end + @info "Do ctrl+f TODO to find regions to update for newly added project!" end From 2a8b602728e79d362b3d9ebb84c09f238cd350a2 Mon Sep 17 00:00:00 2001 From: hannahilea Date: Mon, 1 Apr 2024 13:45:49 -0400 Subject: [PATCH 4/8] remove commented-out google analytics --- index.html | 25 ------------------------- 1 file changed, 25 deletions(-) diff --git a/index.html b/index.html index 5e9b42c..538ac23 100755 --- a/index.html +++ b/index.html @@ -65,31 +65,6 @@
    DSP ENGINEER | MAKER
    - - From 9c2486d09557df623aab2a3f63aa9560ad67d53f Mon Sep 17 00:00:00 2001 From: hannahilea Date: Mon, 1 Apr 2024 20:45:56 -0400 Subject: [PATCH 5/8] fill out template todos --- projects.html | 5 +++-- projects/wonderful-world/index.html | 9 +++++---- projects/wonderful-world/sketch.js | 5 +++-- utilities.jl | 4 ++-- 4 files changed, 13 insertions(+), 10 deletions(-) diff --git a/projects.html b/projects.html index 283e2fa..6c37a0a 100644 --- a/projects.html +++ b/projects.html @@ -33,9 +33,10 @@

    @hannahilea's projects