Skip to content

Instantly share code, notes, and snippets.

import { INestApplication } from '@nestjs/common';
import { Database, Resource } from 'admin-bro-typeorm';
import AdminBro from 'admin-bro';
import * as AdminBroExpress from 'admin-bro-expressjs';
export async function setupAdminPanel(app: INestApplication): Promise<void> {
/**
import { BaseEntity, Column, Entity, PrimaryGeneratedColumn } from 'typeorm';
@Entity()
export class User extends BaseEntity {
@PrimaryGeneratedColumn()
id: number;
@Column({ unique: true })
email: string;
import { INestApplication } from '@nestjs/common';
import AdminBro from 'admin-bro';
import * as AdminBroExpress from 'admin-bro-expressjs';
export async function setupAdminPanel(app: INestApplication): Promise<void> {
/** Create adminBro instance */
const adminBro = new AdminBro({
resources: [], // Here we will put resources
rootPath: '/admin', // Define path for the admin panel
import { NestFactory } from '@nestjs/core';
import { AppModule } from './app.module';
import { setupAdminPanel } from './admin-panel/admin-panel.plugin';
async function bootstrap() {
const app = await NestFactory.create(AppModule);
/**
* Setup Admin panel
import { INestApplication } from '@nestjs/common';
export async function setupAdminPanel(app: INestApplication): Promise<void> {
}
{
"extends": "stylelint-config-primer",
"plugins": [
"stylelint-scss"
],
"rules": {
"indentation": 4,
"selector-max-type": null
}
}
{
"extends": "gts/tslint.json",
"rulesDirectory": [
"node_modules/codelyzer"
],
"rules": {
"arrow-return-shorthand": true,
"callable-types": true,
"class-name": true,
"comment-format": [
webpackJsonp(["main"],{
/***/ "./src/$$_lazy_route_resource lazy recursive":
/***/ (function(module, exports, __webpack_require__) {
var map = {
"./badges/badges.module": [
"./src/app/main/kid/rewards/badges/badges.module.ts",
"badges.module"
],
@SergeyMell
SergeyMell / image_with_preview_input.rb
Created February 17, 2018 22:31
Formtastic extension of file inputs to make them as inputs with image preview
class ImageWithPreviewInput < Formtastic::Inputs::FileInput
def to_html
options.merge!(hint: preview_html.html_safe)
super + "<script>#{preview_script}</script>".html_safe
end
private
def preview_html
@SergeyMell
SergeyMell / ngsw-config.json
Last active November 16, 2017 09:56
Configuration file for Service Worker in Angular applications
{
"index": "/index.html",
"appData": {
"name": "Angular Service Worker Example",
"description": "Example of Angular v5 application utilizing SW functionality"
},
"assetGroups": [
{
"name": "app",
"installMode": "prefetch",