mkasberg
Repos
27
Followers
25
Following
14

🛠️ Mike's dotfiles. Managed with https://www.chezmoi.io/

26
0

🌱 Seed scripts for popular (& unpopular) scripting languages.

8
20

🐳 Learn Docker by doing it.

9
14

A program to solve Wordle!

0
0

Events

issue comment
Replace document.execCommand("copy") with clipboard API

Yes, and it is likely that most of the copyToClipboard() function will need to be re-written (and might be significantly shorter since we might not need to highlight the text anymore to perform the copy). We want to copy the inner text of document.getElementById("seedScript").

Created at 9 hours ago
issue comment
JavaScript add comments with reference links to scripts

The Javascript seed doesn't need any documentation links since it's not using an arg parsing library, only arrays.

However, the Deno script (essentially JS), uses the Deno flags library, and it would be good to link to the docs there.

Created at 9 hours ago

Switch to prism.js for syntax highlighting

Main motivation is that prism.js seems to highlight more syntax expressions and have fewer bugs (e.g. correctly handling multi-line strings) than highlight.js. It also has more plugins, which might let us do some interesting things down the road if we want to.

Created at 10 hours ago
issue comment
Switch to prism.js for syntax highlighting

highlight.js: image

prism.js: image

Created at 10 hours ago
pull request opened
Switch to prism.js for syntax highlighting

Main motivation is that prism.js seems to highlight more syntax expressions and have fewer bugs (e.g. correctly handling multi-line strings) than highlight.js. It also has more plugins, which might let us do some interesting things down the road if we want to.

Created at 10 hours ago
create branch
mkasberg create branch prism
Created at 10 hours ago
opened issue
Replace document.execCommand("copy") with clipboard API

We're currently copying text to the clipboard like this:

https://github.com/mkasberg/script-seed/blob/f8fc60cfa72a9b666fbbcc80cc96c500a9bcb0c1/main.js#L129

However, the execCommand API is deprecated.

We should replace it with Clipboard.writeText.

I'm not 100% sure, but this might be difficult to test locally if the clipboard API requires HTTPS...

Also, note that we might be able to remove some code that selects the text before executing copy since with the new API we can just get the inner text and write it directly to the clipboard.

Created at 10 hours ago

(doc) add links for references

Created at 11 hours ago
pull request closed
(doc) add links for references

additions for https://github.com/mkasberg/script-seed/issues/82

Created at 11 hours ago

Add getopts reference for bash

Add a link to https://man7.org/linux/man-pages/man1/getopts.1p.html in the bash source code where getopts is used. This manpage is the most descriptive I was able to easily find online, and it includes an example of usage.

Created at 12 hours ago
delete branch
mkasberg delete branch bash-reference
Created at 12 hours ago
pull request closed
Add getopts reference for bash

Add a link to https://man7.org/linux/man-pages/man1/getopts.1p.html in the bash source code where getopts is used. This manpage is the most descriptive I was able to easily find online, and it includes an example of usage.

Created at 12 hours ago
opened issue
Add comments with reference links to scripts

When we use an argument parsing utility in our sample scripts (like getopts in bash), it would be good to link to the documentation of that library/method so someone who wants to modify the sample script can easily find a reference to read about how the method works and what it's capabilities are. Where possible, this should be a link to official documentation (instead of StackOverflow or a blog).

Example for bash: #81

Created at 12 hours ago
pull request opened
Add getopts reference for bash

Add a link to https://man7.org/linux/man-pages/man1/getopts.1p.html in the bash source code where getopts is used. This manpage is the most descriptive I was able to easily find online, and it includes an example of usage.

Created at 12 hours ago
create branch
mkasberg create branch bash-reference
Created at 12 hours ago
issue comment
Add Haskell Seed Script

E.x. Install haskell-platform with apt-get in the Dockerfile and use this as a starting point:

#!/usr/bin/env runhaskell

main :: IO ()
main = putStrLn "Hello, World!"
Created at 12 hours ago
issue comment
Add a Lisp Script Seed

E.x. Install sbcl with apt-get in the Dockerfile and use this script as a starting point:

#!/usr/bin/env -S sbcl --script

(write-line "Hello, world!")
Created at 12 hours ago
pull request closed
Update server for python 3

In https://github.com/mkasberg/script-seed/pull/76, we updated to Ubuntu 22.04 for our Docker container used for tests and serving the site locally. This update brought with it a change to python 3 as our default, and that broke our bin/server script since python 2 was no longer installed.

Update bin/server to use python3, which will be available in our Docker container.

Created at 12 hours ago

Update server for python 3

In https://github.com/mkasberg/script-seed/pull/76, we updated to Ubuntu 22.04 for our Docker container used for tests and serving the site locally. This update brought with it a change to python 3 as our default, and that broke our bin/server script since python 2 was no longer installed.

Update bin/server to use python3, which will be available in our Docker container.

Created at 12 hours ago
delete branch
mkasberg delete branch server
Created at 12 hours ago
pull request opened
Update server for python 3

In https://github.com/mkasberg/script-seed/pull/76, we updated to Ubuntu 22.04 for our Docker container used for tests and serving the site locally. This update brought with it a change to python 3 as our default, and that broke our bin/server script since python 2 was no longer installed.

Update bin/server to use python3, which will be available in our Docker container.

Created at 12 hours ago
create branch
mkasberg create branch server
Created at 12 hours ago

Use a unicode apostrophe in bash sample

It looks a little nicer, but the primary advantage of doing this is that using a single quote ' breaks hilightjs. Using a unicode apostrophe means the hilightjs will continue highlighting the rest of the file correctly.

Created at 12 hours ago
delete branch
mkasberg delete branch bash-hl
Created at 12 hours ago
pull request closed
Use a unicode apostrophe in bash sample

It looks a little nicer, but the primary advantage of doing this is that using a single quote ' breaks hilightjs. Using a unicode apostrophe means the hilightjs will continue highlighting the rest of the file correctly.

Before: image

After: image

Created at 12 hours ago
pull request opened
Use a unicode apostrophe in bash sample

It looks a little nicer, but the primary advantage of doing this is that using a single quote ' breaks hilightjs. Using a unicode apostrophe means the hilightjs will continue highlighting the rest of the file correctly.

Before: image

After: image

Created at 13 hours ago
create branch
mkasberg create branch bash-hl
Created at 13 hours ago
delete branch
mkasberg delete branch groovy-upgrade
Created at 1 day ago

Upgrade Groovy to 4.0.5

Upgrade Groovy to 4.0.5, which is the latest stable version from https://groovy.apache.org/download.html. Using 4.0.5 seems to require an import statement for CliBuilder that wasn't required in Groovy 3.

Created at 1 day ago