The words Under construction in black text on a yellow background with diagonal black stipes surrounding it
I'm in the process of moving my site. It's still a work in progress. Please excuse the mess and broken links.

Making Buttons On A Local Hugo Site To Edit The Files

TODO: Pull subtitle into page object

`youtube: https://www.youtube.com/watch?v=l0k20Id3_iA`

I realized that doing streams is a lot like Rubber Duck Debugging

Also, I don't really use it for debugging, but instead of a duck, I have a Memento Mori.

Notes from the stream:

- Running PHP in MAMP, you can use this to launch a file in whatever editor it's defaulted to:

code_start_default_section code_end_default_section

- The final thing is that I ended up using parse-url instead of split based on feedback in chat. It's good stuff: https://www.php.net/manual/en/function.parse-url.php

Debugging Stuff

I'm moving stuff around right now. All this below is helping me figure out where to put stuff

        -- title

Making Buttons On A Local Hugo Site To Edit The Files

-- p

`youtube: https://www.youtube.com/watch?v=l0k20Id3_iA`

-- p

I realized that doing streams is a lot like <<link|Rubber Duck Debugging|https://en.wikipedia.org/wiki/Rubber_duck_debugging). Talking to the stream makes you think through things the same way you would to the duck (or, you know, to someone else.>>

-- p

Also, I don't really use it for debugging, but instead of a duck, I have a <<link|Memento Mori|https://en.wikipedia.org/wiki/Memento_mori>>.

-- p

Notes from the stream:

-- p

- Running PHP in MAMP, you can use this to launch a file in whatever editor it's defaulted to:

-- code/
-- php{numberLines: true}

shell_exec('open /path/to/file/index.md');

-- /code

-- p

- Here's the stuff I tried that didn't work:

-- code/
-- bash

exec("'/Applications/Sublime Text.app/Contents/SharedSupport/bin/subl' /Users/alans/woodshed/launchpad/html-prod");

	exec("python -c 'import os; os.system(\'/usr/local/bin/st\')'");

	$cmd = "python -c 'import os; os.system(\"open /Users/alans\")'";
	exec($cmd);

	$cmd = 'open "/Applications/Sublime Text.app"';
	exec($cmd);

	$cmd = "python -c 'import os; os.system(\"/usr/local/bin/st\")'";
	exec($cmd);
	
	$cmd = '"/Applications/Sublime Text.app/Contents/SharedSupport/bin/subl"';
	exec($cmd);

	shell_exec('/bin/bash -c open .');

-- /code

-- p

### Links from the stream:

-- p

- https://exercism.io

-- p

- https://www.php.net/manual/en/reserved.variables.get.php

-- p

This is a great piece of code from stackify that setups up so you can send php messages to the console.

-- p

https://stackify.com/how-to-log-to-console-in-php/

-- code/
-- php{numberLines: true}

<?php
function console_log($output, $with_script_tags = true) {
    $js_code = 'console.log(' . json_encode($output, JSON_HEX_TAG) . 
');';
    if ($with_script_tags) {
        $js_code = '<script>' . $js_code . '</script>';
    }
    echo $js_code;
}

-- /code

-- p

- The final thing is that I ended up using parse-url instead of split based on feedback in chat. It's good stuff: https://www.php.net/manual/en/function.parse-url.php


-- categories
-- Live Coding
-- Hugo

-- metadata
-- date: 2020-09-27 00:00:00
-- id: 20engwff
-- status: draft
-- type: post
-- SCRUBBED_NEO: false
-- site: aws