nowfound

Life & fun · March 23, 2022

C

Cppawk

Cppawk launched on March 23, 2022 with 7 votes, #1,239 of 3,153 launches that month and more than 50% of that year's launches. The site was still online in September 2026, 4 years on.

What it does

cppawk is a tiny shell script that is used like awk . It invokes the C preprocessor (GNU cpp ) on the Awk code and calls Awk on the result. cppawk understands the basic Awk options like -F and -v , and also understands common cpp options like -I and -Dmacro=value . The cppawk man page describes all the invocation and usage details. For instance, if we define a file called awkloop.h which has these contents: #include "awkloop.h" function main () { awkloop ( "/proc/mounts" ) { rule ( $3 != "ext4" ) { nextrec } rule ( $2 == "/" ) { print $1 } } } BEGIN { main () } We have implemented a facsimile of an Awk input-scanning loop inside a function with a bit of syntactic sugar. However, these few…from kylheku.com

Does a similar job

all alternatives →

More life & fun this month

the category →

Source: Show HN post ↗

Launched alongside, March 2022

the whole month →
  • IM

    Hi HN! I made many small web games in the past with Unity or Phaser. But this time I wanted to make something completely on my own. So I coded a basic game framework in plain JavaScript, and used it to make Almost Pong. This was a really fun project that taught me a lot about JavaScript, and I plan to make more minimalist games with this framework. Interesting fact: Almost Pong doesn't load any assets, all sprites and sounds are generated with code. Happy to answer questions, and please let me know if you have any feedback on the game. Thanks!

    Dev tools · 2022 · lessmilk.com

  • IM

    Life & fun · 2022 · networksfromscratch.com

  • HA

    Paste the following into the console of any HN page - for annotated avatars on all HN comments. (self contained code) for(u of document.querySelectorAll('.hnuser'))for(u.prepend(c=document.createElement('canvas')),x=c.getContext('2d'),c.width=18,c.height=14,s=u.innerText,r=1,i=28+s.length;i--;i>>29>X*X/3+Y/2&&x.fillRect(6+2*X,2*Y,2,2)&x.fillRect(6-2*X,2*Y,2,2):r+=s.charCodeAt(i-28,x.fillStyle='#'+(r>>8&0xFFFFFF).toString(16)))r^=r>>17,r^=r>2

    Dev tools · 2022

  • Tome Beta▲697

    The storytelling tool for work

    Work · 2022 · tome.app

  • Kairn▲694

    Regain control over your days

    Dev tools · 2022

  • How well do you know your area? Test your knowledge by locating streets on a map.

    Work · 2022 · backofyourhand.com