From 4149435657b6c8fa72749596da5d101cb19c4197 Mon Sep 17 00:00:00 2001 From: Steven Clontz Date: Mon, 6 Jan 2025 22:00:41 +0000 Subject: [PATCH 1/2] swap chapters --- source/main.ptx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/main.ptx b/source/main.ptx index 8618a32..67fa7fe 100644 --- a/source/main.ptx +++ b/source/main.ptx @@ -19,8 +19,8 @@ - + From 0173c25dded388720045deb543e8607d83a38278 Mon Sep 17 00:00:00 2001 From: Steven Clontz Date: Mon, 6 Jan 2025 22:41:30 +0000 Subject: [PATCH 2/2] move a few things around --- source/ch-coding.ptx | 74 +++++++++++++--------------------------- source/ch-first-repo.ptx | 11 ++++++ source/ch-website.ptx | 50 +++++++++++++++++++++++++-- 3 files changed, 81 insertions(+), 54 deletions(-) diff --git a/source/ch-coding.ptx b/source/ch-coding.ptx index fff708e..cf7fd58 100644 --- a/source/ch-coding.ptx +++ b/source/ch-coding.ptx @@ -4,8 +4,9 @@
Codespaces

-While the quick GitHub.dev interface is great -for quick edits, many projects require the ability +While the quick GitHub.dev interface we used +to get started in is great +for quick uploads or edits, many projects require the ability to run applications and execute code as you would on your personal computer. Fortunately, GitHub offers a service to run such programs on their servers. @@ -240,50 +241,6 @@ Array.from({ length: 10 }, _ => { Sample Javascript code

-
- Previewing GitHub Pages -

-Another useful application of Codespaces is the ability -to preview your GitHub Pages site created in -. Return to that repository -on GitHub.com and create a new Codespace -(). -

-

-To spin up your live preview, open a terminal by using the -shortcut noted in . To make -sure the necessary software has been installed, type bundle -and hit Enter. Then, you can enter jekyll serve -to start the preview server. -

-

-You'll see some output, and eventually -Server address: http://127.0.0.1:4000. At that time an -alert will appear that says Your application on port 4000 -is available. You can use its Open in browser button, -or hover over the http://127.0.0.1:4000 link to be given -the same option. -

-

-This should open a URL such as -random-words-123randomletters789-4000.app.github.dev, -which will show a live preview of your GitHub Pages site in a new -tab. As soon as you make edits in your Codespace tab, you can -return to this tab to (within a second or two) see how your edits -will update your live site. Note that this URL is private to you, -and your public site won't be updated until you Commit & Sync -your changes -(). -

-

-Personally, I use GitHub.dev (or even just the -GitHub.com edit button) rather than a full -Codespace when adding a quick post or making a quick edit on -many of my GitHub Pages websites. But the Codespace option is very -handy for when bigger changes are necessary, and you want to make -sure everything looks just right before pushing it live to the public. -

-
Managing Your Codespaces

@@ -297,9 +254,9 @@ there is the option to pay for additional resources. As a mathematician who almost exclusively uses GitHub Codespaces for doing the kinds of work described in this handbook (and does so for much longer -periods of time than a tpyical mathematician), +periods of time than a typical mathematician), I've only surpassed GitHub's free quota on the rare occassion -(and when I do, I've paid only \$2-\$6 per month). +(and when I do, I've paid only \$2-\$6 per month). I accomplish this by halting my Codespaces when I'm not actively working on them.

@@ -343,9 +300,11 @@ Here is what these environments look like.
Powering up your Codespce

-By default, your codespace will use a -2-core processor, 8GB of RAM, and 32GB of storage, with a quota of -40 usage hours per month. This is fine for many tasks, +As of January 2025, a default codespace will use a +2-core processor and 8GB of RAM, with a quota of +60 usage hours and 15GB storage per month. (This is increased +to 90 usage hours and 20GB storage for Pro/Education users.) +This is fine for many tasks, but if you're doing data analysis () or formalized mathematics () you may want some more resources at your disposal. @@ -374,5 +333,18 @@ the virtual machine that should be provisioned when creating a Codespace, allowing for the automatic installation of appropriate software/libraries/dependencies necessary for the use of a given repository.

+ +

+ Setting up a custom .devcontainer is a slick way to + ensure you and your collaborators/students are running exactly + the same software (including versions, dependencies, etc.)! + No more It works on my machine while I can't get it + to work on my machine! +

+

+ See VisualStudio.com/docs/devcontainers + to learn more. +

+
\ No newline at end of file diff --git a/source/ch-first-repo.ptx b/source/ch-first-repo.ptx index fa14ac8..b864b08 100644 --- a/source/ch-first-repo.ptx +++ b/source/ch-first-repo.ptx @@ -227,4 +227,15 @@ on each commit to see exactly what has changed from the previous commit across all files.

+
+ Next steps +

+Now that you've gotten the hang of the basics of +committing and pushing changes to a repository, +you can move on to using Codespaces to write +and execute programs and code () +or setting up a webpage hosted by GitHub +(). +

+
\ No newline at end of file diff --git a/source/ch-website.ptx b/source/ch-website.ptx index c6a5b15..b064ee2 100644 --- a/source/ch-website.ptx +++ b/source/ch-website.ptx @@ -19,7 +19,7 @@ without using HTML.)

Use GitHub.dev () -to create three files in the root of your project. +to create three files in the root of a new or existing repository.

  • @@ -243,8 +243,8 @@ edits. After a while () you should be able to refresh your website and see your updated title, name, etc. (In , we will learn how to preview our edits more quickly, and without needing to push them to a -live website, but at the expense of a more complicated -editing environment.) You can repeat this process after each of the +live website, provided we're comfortable using a Codespace as explored in +.) You can repeat this process after each of the edits described below to see your results reflected on the live website.

    @@ -338,4 +338,48 @@ tags: +
    + Previewing GitHub Pages +

    +Another useful application of Codespaces is the ability +to preview your GitHub Pages site created in +. Return to that repository +on GitHub.com and create a new Codespace +(). +

    +

    +To spin up your live preview, open a terminal by using the +shortcut noted in . To make +sure the necessary software has been installed, type bundle +and hit Enter. Then, you can enter jekyll serve +to start the preview server. +

    +

    +You'll see some output, and eventually +Server address: http://127.0.0.1:4000. At that time an +alert will appear that says Your application on port 4000 +is available. You can use its Open in browser button, +or hover over the http://127.0.0.1:4000 link to be given +the same option. +

    +

    +This should open a URL such as +random-words-123randomletters789-4000.app.github.dev, +which will show a live preview of your GitHub Pages site in a new +tab. As soon as you make edits in your Codespace tab, you can +return to this tab to (within a second or two) see how your edits +will update your live site. Note that this URL is private to you, +and your public site won't be updated until you Commit & Sync +your changes +(). +

    +

    +Personally, I use GitHub.dev (or even just the +GitHub.com edit button) rather than a full +Codespace when adding a quick post or making a quick edit on +many of my GitHub Pages websites. But the Codespace option is very +handy for when bigger changes are necessary, and you want to make +sure everything looks just right before pushing it live to the public. +

    +
    \ No newline at end of file