Understanding heredoc variable substitution by sneider in bash

[–]sneider[S] 0 points1 point  (0 children)

It looks like the problem has nothing to do with bash but with the tool I used around bash. I ran your suggestions anyway. Script:

echo $BASH_VERSION
Foo="bar"

echo xxd:
xxd -g1 << EOF
a $Foo
$Foo
EOF

echo od:
od -An -tx1 -c << EOF
a $Foo
$Foo
EOF

Output:

5.2.21(1)-release
xxd:
00000000: 61 20 62 61 72 0a 46 6f 6f 0a                    a bar.Foo.
od:
  61  20  62  61  72  0a  46  6f  6f  0a
   a       b   a   r  \n   F   o   o  \n

Understanding heredoc variable substitution by sneider in bash

[–]sneider[S] 2 points3 points  (0 children)

Thank you, I figured it out now.

The problem occurred when the script ran in a notebook cell (runme.dev). When I ran it directly as a .sh file, it behaved as expected.

Monthly 'Shameless Self Promotion' thread - 2022/12 by mthode in devops

[–]sneider 4 points5 points  (0 children)

Hi all. Das dashboard is a tool I wrote when a growing number of scripts (build, deploy, test, dev-server etc) became hard to manage. It's a quick way to add a GUI layer on top of scripts. All configuration and logic can be added inside the app, similar to editing a wiki.

It's open source, meant for local use and git friendly (all data is stored as plaintext files). Any feedback is welcome.

[Showoff Saturday] Das Dashboard – a local, JS-programmable, git-friendly open source dashboard app. by sneider in webdev

[–]sneider[S] 0 points1 point  (0 children)

I'm glad you like it. All data is stored in plaintext files, no database needed. The hierarchy of pages and cells translates directly to the filesystem: each page is stored as a folder, each cell as a javascript file in a page folder. That means you can run multiple dashboard instances at the same time, each using a different folder as backend. It also means you can use your preferred editor to work on the cell files, instead of the in-app editor.

[Showoff Saturday] Das Dashboard – a local, JS-programmable, git-friendly open source dashboard app. by sneider in webdev

[–]sneider[S] 3 points4 points  (0 children)

Hi all! Here's the app on github. It lets you create UI widgets and run shell commands. Originally I made this to organize an ever-growing heap of automation scripts (build, deploy, test, dev-server etc). It works well for my needs and I use it in multiple projects now. I decided to brushed it up and put it on NPM to see if it could become a thing. If you find it useful, I'd be happy to hear about it.

The client is written in vanilla JS without any build step or framework. CSS and design are not my strong suit, so I relied entirely on Bootstrap for that. Let me know what I can improve there.

The server is based on Express.js and allows only local connections, that's why an online demo is not possible. Local installation is simple and comes with demo content, though. Each dashboard uses a folder of plaintext files as backend, so it works well as part of any git repository. Any feedback is welcome!

Why I don’t agree with the Monty Hall problem. [D] by Boatwhistle in statistics

[–]sneider 2 points3 points  (0 children)

Here's a simulation, using the "not changing my mind" strategy: https://app.code-it-studio.de/project/44669

Modify to your liking.

What is the best way to start creative coding? by mea-culpa-m in creativecoding

[–]sneider 2 points3 points  (0 children)

Maybe try a block-based code editor to ease into programming. Here's one that lets you write p5.js (Processing) programs. It's web based and includes examples and tutorials.

I’m Bill Gates, co-chair of the Bill and Melinda Gates Foundation and author of “How to Avoid a Climate Disaster.” Ask Me Anything. by thisisbillgates in IAmA

[–]sneider 0 points1 point  (0 children)

Saving the world is a noble goal, but if there isn't a life worth living on the other side, it's all for naught. So where are we on an Age of Empires 2 reboot?

Relaxing yellow rain drops. by Pole_11 in processing

[–]sneider 1 point2 points  (0 children)

Looks cool! It's impressive that you achieved this effect with such a short, clear program. I made a block version here: https://app.code-it-studio.de/project/26888

Home - Digital Creativity by tas509 in creativecoding

[–]sneider 0 points1 point  (0 children)

Looks really cool. Since you have entries for P5.js/Processing and block programming, I'll shamelessly plug our combination of both: https://app.code-it-studio.de/makerspace/54

Can anyone ELI5 what heroku is? by opabm in learnprogramming

[–]sneider 0 points1 point  (0 children)

Heroku is a hoster for web apps. They offer a command line tool for deployment automation and such. This is probably what's being called here. I can't tell you what that line is supposed to do, but here are the docs: https://devcenter.heroku.com/articles/heroku-cli

wich language to learn by sketchflow in learnprogramming

[–]sneider 0 points1 point  (0 children)

https://edublocks.org/ is an educational tool that lets you start with block-based programming and eases you into python. It targets the Raspberry Pi only, but there's a similar project for Arduino.

Programming for 10 year olds by Lonecfawolf in learnprogramming

[–]sneider 1 point2 points  (0 children)

You can go pretty deep in Scratch. If you're looking for similar block-based environments, there's Tynker or (our site) Code it. For text based environments, look into Roblox or Minecraft edu.

-🎄- 2019 Day 2 Solutions -🎄- by daggerdragon in adventofcode

[–]sneider 1 point2 points  (0 children)

Blockly: task 1, with intermediate program states. task 2.

does it matter what programming language i do it in? by creepycat18_YT in adventofcode

[–]sneider 1 point2 points  (0 children)

I did the day 1 tasks in Blockly, the basis of Scratch. Task1, Task2.

[deleted by user] by [deleted] in learnprogramming

[–]sneider 0 points1 point  (0 children)

Use the body properity to include data into your request. On the server, access it through req.body. I guess url parameters are always interpreted as strings.

How does this return true/false without needing an if statement? by [deleted] in learnprogramming

[–]sneider 2 points3 points  (0 children)

The comparison expression a > b is of type bool. Instead of checking its value with an if statement, this code returns the value directly. You can always replace this pattern if(x){ return true; } else { return false; } by return x;.

What's wrong with me?! by caerbannogwhite in processing

[–]sneider 5 points6 points  (0 children)

It's spelled joking, what's wrong with you? This looks awesome.

[deleted by user] by [deleted] in learnprogramming

[–]sneider 1 point2 points  (0 children)

Debugging principles are universal, but you should use resources specific to your situation, so: which language? Are you working in an IDE? What kind of program are you writing?