Skip to content

Instantly share code, notes, and snippets.

View mtvspec's full-sized avatar

Timur Lastaev mtvspec

  • 03:50 (UTC +05:00)
View GitHub Profile
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { RealPropertyCommentListComponent } from './real-property-comment-list.component';
import { MessageService } from "primeng/api";
import { PrincipalService } from "@app/principal/service/principal.service";
import { DeviceService } from "@helpers/device.service";
import { DATA_MANAGER_URI, USER_MANAGER_URI, VIEW_MANAGER_URI } from "../../const";
import { environment } from "@environments/environment.prod";
import { NO_ERRORS_SCHEMA } from "@angular/core";
import { RealPropertyCommentListService } from "@modules/real-property-comments/real-property-comment-list.service";
@mtvspec
mtvspec / docx-template-to-pdf.js
Created August 27, 2021 16:45 — forked from JasonHarrop/docx-template-to-pdf.js
Create PDF proposals, invoices, contracts etc in Javascript from a suitable Word document template
// Step 1: generate docx
var JSZip = require('jszip');
var Docxtemplater = require('docxtemplater');
var fs = require('fs');
var path = require('path');
//Load the docx file as a binary
var content = fs
@mtvspec
mtvspec / index.html
Last active December 4, 2020 18:29
Simple button example
<ns-button label="Button Label"></ns-button>
@mtvspec
mtvspec / graphql_resolver_map_example.ts
Last active July 19, 2020 17:59
GraphQL Resolver Map Example
export const resolvers = {
Query: {
bookList: () => {
return {
count: (obj, args, ctx, info) => BookController.getBookListCount(),
nodes: (obj, args, ctx, info) => BookController.getBookList(),
}
},
book: (obj, args, ctx, info) => BookController.getBook(args['id']),
authorList: (obj, args, ctx, info) => {
@mtvspec
mtvspec / mutation_example.gql
Last active July 19, 2020 17:56
GraphQL Mutation Example
mutation createBook($data: BookInput!) {
createBook(data: $data) {
id
title
description
}
}
{
"data": {
@mtvspec
mtvspec / query_example.gql
Created July 19, 2020 16:32
GraphQL Query Examples
query bookList {
bookList {
count
nodes {
id
title
}
}
}
@mtvspec
mtvspec / schema.gql
Last active July 19, 2020 16:07
GraphQL Schema Example
type Query {
bookList: [BookList!]
book(id: ID!): Book
authorList: [AuthorList!]
author(id: ID!): Author
}
type Book {
id: ID!
title: String!
@mtvspec
mtvspec / resolver.ts
Last active July 19, 2020 15:46
GraphQL resolver example
const authorResolver = (obj, args, ctx, info) => AuthorController.getAuthor(args['id]);
function bookResolver(obj, args, ctx, info) {
return BookController.getBook(args['id')
}