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.
  • ics@tau-ceti.spaceI ics@tau-ceti.space

    @citizen428 @eniko Impressive! 😳😍

    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
    #70

    @ics @eniko

    Not the first word I’d use πŸ˜‚

    ics@tau-ceti.spaceI 1 Reply Last reply
    0
    • citizen428@chaos.socialC citizen428@chaos.social

      @ics @eniko

      Not the first word I’d use πŸ˜‚

      ics@tau-ceti.spaceI This user is from outside of this forum
      ics@tau-ceti.spaceI This user is from outside of this forum
      ics@tau-ceti.space
      wrote last edited by
      #71

      @citizen428 @eniko The first words were "WTF????" - that's why the first emoji πŸ˜‚πŸ˜‚

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

        @necrophcodr Funny you'd say that, because this (`clang -I. -P -E`) but in another context is how this little side quest started.

        necrophcodr@layer8.spaceN This user is from outside of this forum
        necrophcodr@layer8.spaceN This user is from outside of this forum
        necrophcodr@layer8.space
        wrote last edited by
        #72

        @citizen428 I mean it has simple uses too, like adding simple include statements in any file, or, as you've shown, macros.

        I've used it to make a lockfile for my Containerfile, and I'd just build using cpp -E <file> | docker build -f- <...>

        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)

          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
          #73

          @citizen428 I highly recommend combining this with a MAP macro.

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

            @citizen428 I highly recommend combining this with a MAP macro.

            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
            #74

            @ryanc Please don’t give me ideas πŸ˜‚

            ryanc@infosec.exchangeR 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)

              siguza@infosec.spaceS This user is from outside of this forum
              siguza@infosec.spaceS This user is from outside of this forum
              siguza@infosec.space
              wrote last edited by
              #75

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

              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

                fx@chaos.socialF This user is from outside of this forum
                fx@chaos.socialF This user is from outside of this forum
                fx@chaos.social
                wrote last edited by
                #76

                @citizen428 finally, webdev in C

                citizen428@chaos.socialC 1 Reply Last reply
                0
                • 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
                                          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