Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (Cyborg)
  • No Skin
Collapse
Brand Logo

CIRCLE WITH A DOT

  1. Home
  2. Uncategorized
  3. A tale in 3 pictures.

A tale in 3 pictures.

Scheduled Pinned Locked Moved Uncategorized
programming
103 Posts 56 Posters 0 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • citizen428@chaos.socialC citizen428@chaos.social

    @ryanc Please don’t give me ideas 😂

    ryanc@infosec.exchangeR This user is from outside of this forum
    ryanc@infosec.exchangeR This user is from outside of this forum
    ryanc@infosec.exchange
    wrote last edited by
    #77

    @citizen428 Fine. I will not inflict further ideas upon you, but why do you hate fun?

    citizen428@chaos.socialC 1 Reply Last reply
    0
    • citizen428@chaos.socialC citizen428@chaos.social

      A tale in 3 pictures. In which our hero wonders if he can and doesn't stop to ask if he should.

      #c #programming

      endlessmason@hachyderm.ioE This user is from outside of this forum
      endlessmason@hachyderm.ioE This user is from outside of this forum
      endlessmason@hachyderm.io
      wrote last edited by
      #78

      @citizen428
      Finally somebody's optimised CGI.pm's html functions

      Link Preview Image
      CGI::HTML::Functions

      Documentation for CGI.pm Legacy HTML Functionality

      favicon

      MetaCPAN (metacpan.org)

      1 Reply Last reply
      0
      • citizen428@chaos.socialC citizen428@chaos.social

        A tale in 3 pictures. In which our hero wonders if he can and doesn't stop to ask if he should.

        #c #programming

        hirunatan@xarxa.cloudH This user is from outside of this forum
        hirunatan@xarxa.cloudH This user is from outside of this forum
        hirunatan@xarxa.cloud
        wrote last edited by
        #79

        @citizen428 this is funny, because this idea is real (more or less). The https://penpot.app is made this way!

        It's written in Clojure language, that also has a feature of creating macros (although with better syntax checks). We use the `rumext` framework, that defines macros that are expanded in compile time into HTML, react style.

        Link Preview Image
        GitHub - penpot/penpot: Penpot: The open-source design tool for design and code collaboration

        Penpot: The open-source design tool for design and code collaboration - penpot/penpot

        favicon

        GitHub (github.com)

        So here is your idea working in a hugely complex application, with the (little) issue that it's in a language with good macros... 😅

        hirunatan@xarxa.cloudH citizen428@chaos.socialC 2 Replies Last reply
        0
        • hirunatan@xarxa.cloudH hirunatan@xarxa.cloud

          @citizen428 this is funny, because this idea is real (more or less). The https://penpot.app is made this way!

          It's written in Clojure language, that also has a feature of creating macros (although with better syntax checks). We use the `rumext` framework, that defines macros that are expanded in compile time into HTML, react style.

          Link Preview Image
          GitHub - penpot/penpot: Penpot: The open-source design tool for design and code collaboration

          Penpot: The open-source design tool for design and code collaboration - penpot/penpot

          favicon

          GitHub (github.com)

          So here is your idea working in a hugely complex application, with the (little) issue that it's in a language with good macros... 😅

          hirunatan@xarxa.cloudH This user is from outside of this forum
          hirunatan@xarxa.cloudH This user is from outside of this forum
          hirunatan@xarxa.cloud
          wrote last edited by
          #80

          @citizen428 this is a real example of the code in the app:

          [:div {:class (stl/css :modal-overlay)}
          [:div {:class (stl/css :modal-dialog)
          :data-testid "token-theme-update-create-modal"}
          [:> icon-button* {:class (stl/css :close-btn)
          :on-click modal/hide!
          :aria-label (tr "labels.close")
          :variant "action"
          :icon i/close}]
          [:> themes-modal-body*]]]

          1 Reply Last reply
          0
          • citizen428@chaos.socialC citizen428@chaos.social

            The horrors:

            Link Preview Image
            C preprocessor abuse

            C preprocessor abuse. GitHub Gist: instantly share code, notes, and snippets.

            favicon

            Gist (gist.github.com)

            dragonfi@social.jsteuernagel.deD This user is from outside of this forum
            dragonfi@social.jsteuernagel.deD This user is from outside of this forum
            dragonfi@social.jsteuernagel.de
            wrote last edited by
            #81

            @citizen428 Thanks for sharing the code.

            In a weird way, this is exactly what the C preprocessor is designed to do.

            I still don't want to debug a bigger website though.

            citizen428@chaos.socialC 1 Reply Last reply
            0
            • dragonfi@social.jsteuernagel.deD dragonfi@social.jsteuernagel.de

              @citizen428 Thanks for sharing the code.

              In a weird way, this is exactly what the C preprocessor is designed to do.

              I still don't want to debug a bigger website though.

              citizen428@chaos.socialC This user is from outside of this forum
              citizen428@chaos.socialC This user is from outside of this forum
              citizen428@chaos.social
              wrote last edited by
              #82

              @dragonfi@jsteuernagel.de $DEITY no, I'd never want to actually work with this outside of a little late-night hack session.

              1 Reply Last reply
              0
              • ryanc@infosec.exchangeR ryanc@infosec.exchange

                @citizen428 Fine. I will not inflict further ideas upon you, but why do you hate fun?

                citizen428@chaos.socialC This user is from outside of this forum
                citizen428@chaos.socialC This user is from outside of this forum
                citizen428@chaos.social
                wrote last edited by
                #83

                @ryanc I'm just trying to avoid getting nerd sniped into spending any more time on this. I have a much bigger preprocessor abuse planned 😄

                1 Reply Last reply
                0
                • citizen428@chaos.socialC citizen428@chaos.social

                  @wonka @Lemmus I did (do?) have a soft spot for Perl 🙂

                  stefanct@chaos.socialS This user is from outside of this forum
                  stefanct@chaos.socialS This user is from outside of this forum
                  stefanct@chaos.social
                  wrote last edited by
                  #84

                  @citizen428 @wonka @Lemmus that's exactly the place where it stabs you with a rusty spoon.

                  1 Reply Last reply
                  0
                  • siguza@infosec.spaceS siguza@infosec.space

                    @citizen428 omg, you even serve it right from C code?! God, I want to unsee this...

                    citizen428@chaos.socialC This user is from outside of this forum
                    citizen428@chaos.socialC This user is from outside of this forum
                    citizen428@chaos.social
                    wrote last edited by
                    #85

                    @siguza Maximum cursed is what I was going for, so yes. If you prefer CGI and another web server you could use kcgi:

                    Link Preview Image
                    kcgi: minimal CGI and FastCGI library for C/C++

                    A C/C++ library for security-oriented web applications.

                    favicon

                    (kristaps.bsd.lv)

                    1 Reply Last reply
                    0
                    • hirunatan@xarxa.cloudH hirunatan@xarxa.cloud

                      @citizen428 this is funny, because this idea is real (more or less). The https://penpot.app is made this way!

                      It's written in Clojure language, that also has a feature of creating macros (although with better syntax checks). We use the `rumext` framework, that defines macros that are expanded in compile time into HTML, react style.

                      Link Preview Image
                      GitHub - penpot/penpot: Penpot: The open-source design tool for design and code collaboration

                      Penpot: The open-source design tool for design and code collaboration - penpot/penpot

                      favicon

                      GitHub (github.com)

                      So here is your idea working in a hugely complex application, with the (little) issue that it's in a language with good macros... 😅

                      citizen428@chaos.socialC This user is from outside of this forum
                      citizen428@chaos.socialC This user is from outside of this forum
                      citizen428@chaos.social
                      wrote last edited by
                      #86

                      @hirunatan Yeah, there are plenty of versions of this in all kinds of languages. But most of them have actual syntactic macros working on an AST, not just simple text replacement.

                      1 Reply Last reply
                      0
                      • fx@chaos.socialF fx@chaos.social

                        @citizen428 finally, webdev in C

                        citizen428@chaos.socialC This user is from outside of this forum
                        citizen428@chaos.socialC This user is from outside of this forum
                        citizen428@chaos.social
                        wrote last edited by
                        #87

                        @fx You might be the right kind of person to find https://learnbchs.org interesting then.

                        1 Reply Last reply
                        0
                        • malwareminigun@infosec.exchangeM malwareminigun@infosec.exchange

                          @citizen428 This is extra bad because cpp isn't specified in a way you can necessarily cough up matching text and different compilers resolve that problem in their preprocessed output in different ways...

                          citizen428@chaos.socialC This user is from outside of this forum
                          citizen428@chaos.socialC This user is from outside of this forum
                          citizen428@chaos.social
                          wrote last edited by
                          #88

                          @malwareminigun Does the first image not make it clear that this is not a serious post?

                          malwareminigun@infosec.exchangeM 1 Reply Last reply
                          0
                          • mirabilos@toot.mirbsd.orgM mirabilos@toot.mirbsd.org

                            @citizen428 ok, that’s a different kind of using cpp(1) as a webpage templating engine than what I did.

                            Won’t escape, of course…

                            citizen428@chaos.socialC This user is from outside of this forum
                            citizen428@chaos.socialC This user is from outside of this forum
                            citizen428@chaos.social
                            wrote last edited by
                            #89

                            @mirabilos It won't escape and won't do many other things anyone would reasonably want. It's just a late night shitpost.

                            1 Reply Last reply
                            0
                            • aartaka@merveilles.townA aartaka@merveilles.town

                              @citizen428 yes, that’s a thing I built my website on, at some point <https://aartaka.me/this-post-is-cpp.html> (migrated to ed(1) since then.)

                              citizen428@chaos.socialC This user is from outside of this forum
                              citizen428@chaos.socialC This user is from outside of this forum
                              citizen428@chaos.social
                              wrote last edited by
                              #90

                              @aartaka Love the cursors, instant follow. Keep the web weird!

                              aartaka@merveilles.townA 1 Reply Last reply
                              0
                              • L luc0x61@mastodon.gamedev.place

                                @citizen428 The fact you can jump off the window isn't a good reason to do it. And don't mention someone brave who did: they're on the ground floor, stupid.

                                citizen428@chaos.socialC This user is from outside of this forum
                                citizen428@chaos.socialC This user is from outside of this forum
                                citizen428@chaos.social
                                wrote last edited by
                                #91

                                @luc0x61 Really? A cartoon calling it an "extremely bad idea" and an implementation covering a handful of tags wasn't enough of an indication that this was not a serious post?

                                L 1 Reply Last reply
                                0
                                • prlg@mastodon.onlineP prlg@mastodon.online

                                  @citizen428 *points and snaps* Nord Theme.

                                  citizen428@chaos.socialC This user is from outside of this forum
                                  citizen428@chaos.socialC This user is from outside of this forum
                                  citizen428@chaos.social
                                  wrote last edited by
                                  #92

                                  @prlg Always Nord theme, on everything. I even made one for the OCaml's utop so it looks less out of place in my terminal:

                                  Link Preview Image
                                  ~citizen428/nord-utop - A Nord color theme for OCaml's utop toplevel - sourcehut git

                                  favicon

                                  (git.sr.ht)

                                  1 Reply Last reply
                                  0
                                  • citizen428@chaos.socialC This user is from outside of this forum
                                    citizen428@chaos.socialC This user is from outside of this forum
                                    citizen428@chaos.social
                                    wrote last edited by
                                    #93

                                    @nabijaczleweli You glorious madman, have a follow 🙂

                                    1 Reply Last reply
                                    0
                                    • ruenahcmohr@infosec.exchangeR ruenahcmohr@infosec.exchange

                                      @citizen428 for GCC, add #define true 1

                                      citizen428@chaos.socialC This user is from outside of this forum
                                      citizen428@chaos.socialC This user is from outside of this forum
                                      citizen428@chaos.social
                                      wrote last edited by
                                      #94

                                      @RueNahcMohr Works fine as-is. The Makefile targets `-std=c23` where `true` is an actual keyword. Unless I misunderstood your intention here.

                                      1 Reply Last reply
                                      0
                                      • citizen428@chaos.socialC citizen428@chaos.social

                                        @aartaka Love the cursors, instant follow. Keep the web weird!

                                        aartaka@merveilles.townA This user is from outside of this forum
                                        aartaka@merveilles.townA This user is from outside of this forum
                                        aartaka@merveilles.town
                                        wrote last edited by
                                        #95

                                        @citizen428 yay, I didn’t make these in vain 🤩

                                        1 Reply Last reply
                                        0
                                        • citizen428@chaos.socialC citizen428@chaos.social

                                          @luc0x61 Really? A cartoon calling it an "extremely bad idea" and an implementation covering a handful of tags wasn't enough of an indication that this was not a serious post?

                                          L This user is from outside of this forum
                                          L This user is from outside of this forum
                                          luc0x61@mastodon.gamedev.place
                                          wrote last edited by
                                          #96

                                          @citizen428 I've seen enough to witness that some humorous exits have been chosen as real solutions 😀
                                          Would you believe that I've seen someone printing a variable as binary text to further process it with binary logic on single ASCII digits, instead of using the logical operators native of any CPU?

                                          citizen428@chaos.socialC 1 Reply Last reply
                                          0
                                          Reply
                                          • Reply as topic
                                          Log in to reply
                                          • Oldest to Newest
                                          • Newest to Oldest
                                          • Most Votes


                                          • Login

                                          • Login or register to search.
                                          • First post
                                            Last post
                                          0
                                          • Categories
                                          • Recent
                                          • Tags
                                          • Popular
                                          • World
                                          • Users
                                          • Groups