Using #GNU as Assembler (not Assembly, but the Assembler) and ld Linker to spit out a working BMP gradient image.

Yeah, you read it right. I'm not using
#Assembly to produce an image. I'm, instead, using Assembler directives and macros during compile-time to generate a binary file that happens to be a valid image (BMP) file.

File: tonishing.s (GNU Assembly file)

width = 320 height = 240 area = width * height _begin: .ascii "BM" .int fileSize .int 0 .int (_rasterdata - .) _infoheader: .int infoheaderSize .int width # width .int height # height .short 1 # planes .short 24 # bitcount .int 0 # compression .int 0 # imagesize .int 11811 # xpixperm .int 11811 # ypixperm .int 0 # colorsused .int 0 # colorsimp infoheaderSize = (. - _infoheader) _rasterdata: n=area+1 .rept height .rept width byten=((n*255)/area)&0xFF rn=(192*byten)/255 gn=(64*byten)/255 bn=(128*byten)/255 .byte rn,gn,bn n=(n-1) .endr .endr fileSize = (. - _begin)
File: run.sh (Shellscript)#!/bin/sh clear rm astonishing.bin rm tonishing.o as tonishing.s --64 -o tonishing.o # The pun is _astonishingly_ intended. strip -R .comment -R .note.gnu.property tonishing.o ld -n -x -s -N --oformat binary --unique=.note.gnu.property -o astonishing.bin tonishing.o magick identify -verbose astonishing.binI run the whole thing with... wait for it... #nodemon!

That's right: the tool intended for
#Nodejs hot-reloading, is being leveraged for GNU Assembly, which is itself being leveraged for compile-time instructions to produce a whole BMP image.
nodemon -e "s sh" --exec ./run.sh
While I have a
#Codeberg account, it's under my personal name where I published old projects from #GitHub, so I should do a second account for this pseudonym... but I'm not sure if this is against the Codeberg rules... So I'm posting the whole thing through a Calckey post instead.

#programming #devlog #dev #devhacks #quirks #codegolf #experiments #surreal #absurd

One day I'm tinkering with #Ruby and #JS one-liners and their quirks, the other day I'm tinkering with CPU registers and instructions via #GNU #Assembly. Guess I'm into the latter, now (as strange as it may sound, I'm using a #nodemon + #Makefile pipeline to re-compile and re-run Assembly every time I change the #code, thus turning Assembly into a live-coding platform of sorts)
I was today years old when I discovered Nodemon. It gives you really nice hot reloading for Node. Quite useful for APIs or Discord bots. Probably more too, but that's what I use it for. I just added something like:
"mon": "nodemon index.js"
to my Discord bot's "scripts" section of package.json, so I can run `npm run mon` and now it reloads whenever I save a file.
https://www.npmjs.com/package/nodemon
#JavaScript #Discord #DiscordJS #Nodemon #node
nodemon

Simple monitor script for use during development of a Node.js app.. Latest version: 3.1.7, last published: 7 days ago. Start using nodemon in your project by running `npm i nodemon`. There are 6225 other projects in the npm registry using nodemon.

npm

I had never seen the sponsors page for the #nodemon project (https://nodemon.io/) but omg, it's full of online casinos, which... I mean, they do seem to be sponsors so that's fine but just felt like being served ads for a moment ๐Ÿ˜…

#dev #javascript #node #nodejs #webdev #development

nodemon

First post of the year, hopefully that sets a trend for more posts than last year.

Node.js with TypeScript - Setting up a #Node.js app with #TypeScript, #Nodemon, and #Mocha/#Chai tests

https://medium.com/from-the-couch/node-js-with-typescript-f4d057df5a15

Node.js with TypeScript โ€“ From The Couch โ€“ Medium

Setting up a Node.js app with TypeScript, Nodemon, and Mocha/Chai tests