Skip to content

Instantly share code, notes, and snippets.

View matt212's full-sized avatar
Open for consultation , Freelance and excited to collaborate and contribute


Open for consultation , Freelance and excited to collaborate and contribute
View GitHub Profile
contentSecurityPolicy: {
directives: {
defaultSrc: ["'self'"],
scriptSrc: ["'self'","","","'unsafe-inline'"],
styleSrc: ["'self'", '', "'unsafe-inline'"],
imgSrc: ["'self'", 'https://*.com'],
fontSrc: ["'self'", 'https://*.com', 'data:']
//const pinoInspector = require("pino-inspector");
const path = require("path");
const fastify = require("fastify")({
//logger: { prettyPrint: true, level: "debug", prettifier: pinoInspector },
ajv: {
plugins: [[require("ajv-keywords"), ["transform"]]],
matt212 / API Response
Created July 29, 2022 20:27
API Response
matt212 / customResponse
Created July 29, 2022 20:23
"rows": [{
"employeesid": 20667909,
"first_name": "joi",
"last_name": "baker",
"gender": "M",
"birth_date": "2020-01-02T00:00:00.000Z",
"recordstate": true,
"created_date": "2020-12-06T09:17:39.413Z",
"updated_date": "2020-12-06T09:17:39.413Z"
matt212 / gist:4094152be78ed2604313badff5ab115c
Created July 22, 2022 18:54
Sample search and group clause
File Refer
I would to optimized below query
select a.gender from "employees" as a
where lower( gender ) LIKE 'f%' group by gender
limit 20
matt212 /
Last active November 19, 2020 18:52
Nodejs+postgres+redis Env Setup for App
sudo apt update
sudo apt install nodejs
sudo apt install npm
sudo apt-get update
sudo apt install postgresql postgresql-contrib
sudo apt install redis-server
sudo service redis-server start
matt212 / meh.js
Created March 22, 2019 15:02
convert json array to js object
var newObj = internObj.reduce((a, b) => Object.assign(a, b), {})
"openapi": "3.0.0",
"info": {
"description": "This is a sample server Petstore server.",
"version": "1.0.0",
"title": "Swagger Petstore",
"termsOfService": "",
"contact": {
"email": ""
matt212 / sample.yaml
Created January 31, 2019 20:20
multiple keys issues with different payload
swagger: "2.0"
description: "This is a sample server Petstore server. You can find out more about Swagger at []( or on [, #swagger]( For this sample, you can use the api key `special-key` to test the authorization filters."
version: "1.0.0"
title: "Swagger Petstore"
termsOfService: ""
email: ""
name: "Apache 2.0"
matt212 / base.html
Last active May 15, 2018 15:08
Custom Modular Multiselect plugin and its implementation
reason for creating this plugin
which states that We need to modify our server api for client side plugin feature which is reallllly BAD !
also if you guys find any multiselect + autopopulate with ajax and edit mechanism please comment below on gist !
1. include modular-multiselect-plugin.js in base.html
2. include data-utils.js & plugin-enduser-implementation.js in base.html
3. include modular-multiselector.css in base.html