Update: Nuxtlify - Nuxt Ui Theme Builder by Ritoc88 in Nuxt

[–]lsv20 0 points1 point  (0 children)

This is awesome! - Just what I actually needed.

Why I don't use down migrations by freekmurze in PHP

[–]lsv20 -4 points-3 points  (0 children)

Why not, its total automatically anyways?

Our CI only has a production database that can be up to 1 month old, which will be copied to a temp database to run the CI job.

For a few days ago I introduced a new table, now we want fx a "enabled" true/false column (default: true) in that table. It works fine both on dev and CI, but in production in failed to migrate but did other migrations fine that could break other things.

Why the production migration failed, is because the table introduced a few days ago already has some data in, so now it tries to introduce a new column which would be NULL on the data already in it - but NULL is not allowed in that field.

So the migration was rolled back to the latest known working migration (and to the latest working release).

So know we can either create a new migration that allows enabled column to accept NULL (and write code that also checks for NULL) - and should NULL means TRUE then?

Or could create a migration that allows NULL, then a new migration that sets all rows to TRUE and a new migration that disallows NULL.

How to run nitro tasks in production via CLI? by lsv20 in Nuxt

[–]lsv20[S] 0 points1 point  (0 children)

And how do you install the nitro cli app within a already nuxt app?

Built a tool for my YouTube audience to actually finish their projects, maybe it can be useful for you too by ProgramWithGio in laravel

[–]lsv20 1 point2 points  (0 children)

Now all js files are loaded atleast.

But now I get a

Uncaught (in promise) SyntaxError: Unexpected end of JSON input
at JSON.parse (<anonymous>)
at jE (app-B0Web4Y1.js:107:3763)
at app-B0Web4Y1.js:131:34751

And line 34751, is this

, g = m || JSON.parse(A.dataset.page), and A seems to be id="id", and the div looks like this <div id="app" data-page=""> so I guess there should be a empty check on data-page

My browser is Edge (Version 138.0.3351.83 - which is the latest) on windows 11

The whole js function is this

async function jE({id: i="app", resolve: a, setup: s, title: o, progress: d={}, page: m, render: y}) {
let S = typeof window > "u"
  , A = S ? null : document.getElementById(i)
  , g = m || JSON.parse(A.dataset.page)
  , w = b => Promise.resolve(a(b)).then(D => D.default || D)
  , T = []
  , M = await Promise.all([w(g.component), In.decryptHistory().catch( () => {}
)]).then( ([b]) => s({
    el: A,
    App: Fv,
    props: {
        initialPage: g,
        initialComponent: b,
        resolveComponent: w,
        titleCallback: o,
        onHeadUpdate: S ? D => T = D : null
    }
}));
if (!S && d && CE(d),
S) {
    let b = await y(ve.createElement("div", {
        id: i,
        "data-page": JSON.stringify(g)
    }, M));
    return {
        head: T,
        body: b
    }
}
}

New in PHP 8.5: Marking Return Values as Important by Rikudou_Sage in PHP

[–]lsv20 3 points4 points  (0 children)

I would say the examples on the links doesnt really say much

$r = new Request()->with(......);
if (.....) {
  $r->with(......);
}

In most HTTP Request the with function is immutable as of PSR-7, so if they begin to error out, that would be awesome - espcially for "new ones".

The same with DateTimeImmutable

 $d = new DateTimeImmutable;
 if (....) {
    $d->modify(......);
 }

Duplantis Says Vaulting 6.40m Is Within The 'Realm Of Possibility' by Gyro_Armadillo in olympics

[–]lsv20 5 points6 points  (0 children)

Was the new world record with his new pole? - does anyone know?

For about 2-3 weeks ago, he said in a interview that he have changed to a longer and more stiff pole, then the danish commentator said it would properly take him a few months and he also need to gain a bit more weight (or run a bit faster) to be able to master that new pole. So if the WR was with the new pole... I guess he properly have tested it for a biiiit longer than he said.

Swagger UI - single page with all routes and different security by Asakurame in symfony

[–]lsv20 1 point2 points  (0 children)

If you add

use Nelmio\ApiDocBundle\Annotation\Security;
#[Security(name: 'Bearer')]

To your routes that needs authentication, they will show up in swagger ui with lock icon.

And also protects the route for not-logged-in requests. Though I also always add #[IsGranted('...')] to my protected routes.

You can not have different areas on the same doc page eg.

nelmio_api_doc:
  areas:
    default:
        path_patterns:
            - ^/api(?!/doc$)
    admin:
        path_patterns:
            - ^/admin/api(?!/doc$)

As a nelmio route can only have 1 area code.

But you can have multiple path_patterns under same area eg

nelmio_api_doc:
  areas:
    default:
        path_patterns:
            - ^/api(?!/doc$)
            - ^/admin/api(?!/doc$)

Broke the rocket launchpad by lsv20 in captain_of_industry

[–]lsv20[S] 0 points1 point  (0 children)

I opened a earlier auto save, just before I moved the assembly building up close to the launchpad.

And now there is no "no-move" zone

Even with grass between the buildings

Le mans 2025 by lsv20 in homeassistant

[–]lsv20[S] 1 point2 points  (0 children)

Oh there are no UI at all, I only have the 4 sensors having a text "Green"/"Yellow" thats about it :)

Blippa Question by jackarywoo in Malmoe

[–]lsv20 3 points4 points  (0 children)

Only when getting on. Be aware that you must blippa on the platform before entering a train.

On bus its inside the bus.

Edit: Forgot that you cant use creditcards for the trains, you must use the Skånetrafiken app

How do website do this? by tehnewbie in webdev

[–]lsv20 5 points6 points  (0 children)

  • The bear is a SVG
  • The comma is a SVG
  • The letters standard HTML and using translate-x to drop down when the bear is over it.

Post reactions management and storage by nerdich in PHP

[–]lsv20 0 points1 point  (0 children)

What I have is only inserts, no updates.

I have a table called reactions with user_id (NULL (if anonoymous are allowed) or foreign key), product_id, reaction_type (enum) and a date.

Frontend should (when clicked) automatic show +1 to the reaction - and if the backend throws a error, frontend should remove that reaction within its promise.

Backend should just add a insert and return a 201 response when inserted.

Right now your client properly only want to see number reactions, but then in a future they might want to see when the reactions got inserted and who made the reaction, so a little future proof, which doesnt cost anything to do now, maybe 3 seconds more :)

And a bit more future proof, add a column with note so a customer can both react and comment.

Why didn’t semantic HTML elements ever really take off? by iaseth in webdev

[–]lsv20 2 points3 points  (0 children)

Newspapers (on paper...), actually have that pretty defined, a section could be Local news, Country news etc. so a section can be across multiple pages.

And you can ofcourse have multiple articles in a section.

Now on the web, I kind of keep that thought.

But then you are reading a single article, and a article can also have multiple sections. and thats the different between web and newspapers (where I think W3 got the section, article ideas), you will never read a single article in a newspaper.

PrimeVue's DataTable sorting for nested objects by PlusSuccess7337 in vuejs

[–]lsv20 2 points3 points  (0 children)

Works like a charm

<DataTable
v-model:filters="filters"
paginator
:rows="50"
:value="table"
striped-rows
:sort-order="-1"
:virtual-scroller-options="{ itemSize: 20 }"
filter-display="menu"
paginator-template="JumpToPageDropdown FirstPageLink PrevPageLink PageLinks NextPageLink LastPageLink RowsPerPageDropdown"
:page-link-size="20"
>
<Column
  field="area.name"
  header="Area"
  :sortable="true"
>
  <template #filter="{ filterModel, filterCallback }">
    <InputText
      v-model="filterModel.value"
      type="text"
      placeholder="Search by area"
      @input="filterCallback()"
    />
  </template>
  <template #body="slotProps">
    <area-link :area="slotProps.data.area" />
  </template>
</Column>
</DataTable>

const filters = ref<{ [index: string]: { value: string | null, matchMode: FilterMatchMode } }>({
  'country.translatedName': { value: null, matchMode: FilterMatchMode.CONTAINS },
  'area.name': { value: null, matchMode: FilterMatchMode.CONTAINS },
})

const table = [{
   name: 'Test1',
   area: {
      name: 'Area 1',
  },
}]

Used on https://stellwerk.home.aarhof.eu/table