204 karma · joined December 23, 2014
Before zipapp came out I built superzippy to do it. Needed to distribute some python tooling to users in a university where everyone was running Linux in lab computers. Worked perfectly for it.
That’s what I started out doing as well. At some point I got tired of it, and after writing the script I realized the tighter feedback loop was really nice.
Location: Portland, OR
Remote: Yes
Willing to relocate: Yes (Only to the Bay Area)
Technologies: Most recently TypeScript, Python, React, PostgreSQL, GCP.
Resume: https://resume.johncs.com
Email: johnsullivan.pem@gmail.com
Full-stack engineer with professional experience in other areas including Unity, desktop, mobile, and set-top boxes. I've founded two small businesses with modest success but prefer the life of an IC.I started programming 24 years ago when I was 7 and have been continuously loving and learning more about my craft since.
I've very recently started looking for a new IC role once again. I am interested in Senior/Staff roles that will allow me to continue expanding my knowledge.
I do not have anything similar for my bank accounts or personal subscriptions.
$ never mind
-bash: never: command not found
Thought I was about to learn about a new utility for a moment. $ alias fooson="node --eval \"console.log(JSON.stringify(eval('(' + process.argv[1] + ')')))\""
$ fooson "{time: $(date +%s), dir: '$HOME'}"
{"time":1457195712,"dir":"/Users/jpm"}
It may be a bit nicer to place that JavaScript in your path as a node script instead of using an alias. #!/usr/bin/env node
console.log(JSON.stringify(eval('(' + process.argv[2] + ')')))
Since fooson's argument is being interpreted as JavaScript, you can access your environment through process.env. But you could make a slightly easier syntax in various ways. Like with this script: #!/usr/bin/env node
for(const [k, v] of Object.entries(process.env)) {
if (!global.hasOwnProperty(k)) {
global[k] = v;
}
}
console.log(JSON.stringify(eval('(' + process.argv[2] + ')')))
Now environmental variables can be access as if they were JS variables. This can let you handle strings with annoying quoting. $ export BAR="\"'''\"\""
$ fooson '{bar: BAR}'
{"bar": "\"'''\"\""}
If you wanted to do this without trusting your input so much, a JSON dialect where you can use single-quoted strings would get you pretty far. $ fooson "{'time': $(date +%s), 'dir': '$HOME'}"
{"time":1457195712,"dir":"/Users/jpm"}
If you taught the utility to expand env variables itself you'd be able to handle strings with mixed quoting as well. $ export BAR="\"'''\"\""
$ fooson '{"bar": "$BAR"}'
{"bar": "\"'''\"\""}
You'd only need small modifications to a JSON parser to make this work.Tryna do some neat things with the virtual tabletop I've built (Shmeppy [3]) as well. Getting its renderer off of the 2D Canvas API and onto WebGL, as well as some of its more perf-sensitive code onto WASM.
[1] https://ircv3.net [2] https://github.com/thelounge/thelounge [3] https://shmeppy.com
Retrieving a whole row rather than just a single column from a database that's likely on a local network definitely doesn't seem "hugely wasteful", especially for smaller projects.
Indeed I add the following two lines to every bash script I write:
set -exu
shopt -s failglobIt has much more than just basic coding and web design too :).