Skip to content

Instantly share code, notes, and snippets.

3a4,92
> var compilerRuntime = { exports: {} };
> var reactCompilerRuntime_production = {};
> /**
> * @license React
> * react-compiler-runtime.production.js
> *
> * Copyright (c) Meta Platforms, Inc. and affiliates.
> *
> * This source code is licensed under the MIT license found in the
@petyosi
petyosi / ignore-resize-loop-error.js
Created February 8, 2022 15:33
Ignores error caused by nested resizing
window.addEventListener("error", (e) => {
if (
e.message ===
"ResizeObserver loop completed with undelivered notifications." ||
e.message === "ResizeObserver loop limit exceeded"
) {
e.stopImmediatePropagation();
}
});
@petyosi
petyosi / app.module.ts
Last active August 30, 2022 08:29
crud-app-final
import {BrowserModule} from '@angular/platform-browser';
import {NgModule} from '@angular/core';
import {HttpModule} from '@angular/http';
import {FormsModule} from '@angular/forms';
import {AgGridModule} from 'ag-grid-angular';
import {AthleteService} from './services/athlete.service';
import {StaticDataService} from './services/static-data.service';
import {BrowserModule} from '@angular/platform-browser';
import {NgModule} from '@angular/core';
import {HttpModule} from '@angular/http';
import {FormsModule} from '@angular/forms';
import {AgGridModule} from 'ag-grid-angular';
import {AthleteService} from './services/athlete.service';
import {StaticDataService} from './services/static-data.service';
<app-grid></app-grid>
<div *ngFor="let athlete of athletes">
<span>{{athlete.id}}</span>
<span>{{athlete.name}}</span>
<span>{{athlete?.country?.name}}</span>
<span>{{athlete?.results?.length}}</span>
</div>
package com.aggrid.crudapp.controllers;
import com.aggrid.crudapp.model.Athlete;
import com.aggrid.crudapp.repositories.AthleteRepository;
import org.springframework.web.bind.annotation.*;
import java.util.Optional;
@RestController
public class AthleteController {
package com.aggrid.crudapp.bootstrap;
import com.aggrid.crudapp.model.Athlete;
import com.aggrid.crudapp.model.Country;
import com.aggrid.crudapp.model.Result;
import com.aggrid.crudapp.model.Sport;
import com.aggrid.crudapp.repositories.AthleteRepository;
import com.aggrid.crudapp.repositories.CountryRepository;
import com.aggrid.crudapp.repositories.SportRepository;
import org.springframework.context.ApplicationListener;
package com.aggrid.crudapp.repositories;
import com.aggrid.crudapp.model.Athlete;
import org.springframework.data.repository.CrudRepository;
public interface AthleteRepository extends CrudRepository<Athlete, Long> {
Athlete findByName(String name);
}
package com.aggrid.crudapp.model;
import com.fasterxml.jackson.annotation.JsonManagedReference;
import javax.persistence.*;
import java.util.ArrayList;
import java.util.List;
@Entity
@Cacheable(false)