Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Pictor13/1c2f416b72b553e71caf8e235d73c6be to your computer and use it in GitHub Desktop.
Save Pictor13/1c2f416b72b553e71caf8e235d73c6be to your computer and use it in GitHub Desktop.
[VSCode Rubberduck] Descriptions for OpenAI code generation

Instructions

I want a dockerfile to bring up a container wiith php 8.0, supporting german language either in the OS and inside PHP.
The create a user"app"; the user has UID and GID configurable as APP_UID and APP_GID docker build arguments; the arguments have default value 61234.
The basic php extensions should be enabled; especially for XSLT, XML dom operations, german language support; but skip PECL packages and extensions that are unlikely to be used. In any case, don't exceed with the number of extensions installed; this is not a "production" Dockerfile! Node 14 and npm should be also present in the container.
Switch to the user "app".
Then copy into the container /app folder the composer.json, composer.lock and package.json and package-lock.json from the host machine.
Then install the compser & npm dependencies.
Try to be minimalistic in the instructions; don't repeat too many times the same command. Keep it simple!

Result

FROM php:8.0-fpm

ARG APP_UID=61234
ARG APP_GID=61234

RUN apt-get update && apt-get install -y \
        libxml2-dev \
        libxslt-dev \
        libicu-dev \
        locales \
        nodejs \
        npm \
    && docker-php-ext-install -j$(nproc) \
        xsl \
        xml \
        intl \
    && locale-gen de_DE.UTF-8 \
    && useradd -u $APP_UID -g $APP_GID -m app

USER app

WORKDIR /app

COPY composer.json composer.lock package.json package-lock.json ./

RUN composer install --no-dev \
    && npm install

Instructions

Give me a JS to run in the browser console, to make the page display over all the webpage:

  • animated falling snowflakes, using 2D canvas for the snowflakes
  • plus some Christmas style graphics The snowflakes should move according to gravity and a varying (but not excessively) wind physiques. The snowflakes keep falling and disappearing out of the screen. There is a blue toggle button, in the bottom right of the page, that allows either to start the snow effect and to stop and clear the snoflakes from the screen and the buffer (so we don't generate memory leaks).

Results

Not satisfying.. doesn't run. Doesn't find (or create) snowflakes properly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment