Skip to content

Instantly share code, notes, and snippets.

Avatar
🦊
developing

pookdeveloper pookdeveloper

🦊
developing
View GitHub Profile
View keybase.md

Keybase proof

I hereby claim:

  • I am pookdeveloper on github.
  • I am pookdeveloper (https://keybase.io/pookdeveloper) on keybase.
  • I have a public key ASC18mPD8Y9Lt3Y32z0Gx1wmPIJBIATTU9GHqXwqLQd-Qgo

To claim this, I am signing this object:

View keybase.md

Keybase proof

I hereby claim:

  • I am pookdeveloper on github.
  • I am davidpook (https://keybase.io/davidpook) on keybase.
  • I have a public key ASAv1-dDdo1bjh1ld_3UdxoiV881r-SlyzX8ovVaAsdAgQo

To claim this, I am signing this object:

@pookdeveloper
pookdeveloper / example-model.js
Created Jun 12, 2019
Loopback 3 overrride default method of controller
View example-model.js
'use strict';
module.exports = function (Examplemodel) {
var app = require('../../server/server');
var seguridad = require('../seguridad/seguridad');
var utilidades = require('../utilidades/utilidades');
// Override the method create for model
Examplemodel.once('attached', function () {
@pookdeveloper
pookdeveloper / custom.ts
Last active Apr 18, 2020
Example dinamic querys like loopback with typeorm
View custom.ts
import "reflect-metadata";
import { createConnection, getManager } from "typeorm";
import { resolve } from 'path';
var document: any;
const fs = require('fs-extra') // this is no longer necessary
const hbs = require('handlebars');
const path = require('path');
@pookdeveloper
pookdeveloper / ormconfig.json
Last active Apr 18, 2020
typeORM ormconfig.json
View ormconfig.json
{
"type": "mysql",
"host": "localhost",
"port": 3306,
"username": "root",
"password": "admin",
"database": "mydatabase",
"synchronize": false,
"logging": true,
"entities": [
@pookdeveloper
pookdeveloper / ormconfig.js
Last active Apr 18, 2020
typeORM ormconfig.js
View ormconfig.js
module.exports = {
"type": "mysql",
"host": process.env.HOST_BBDD || "localhost",
"port": process.env.PORT_BBDD || 3306,
"username": process.env.USER_BBDD || "root",
"password": process.env.PASSWORD_BBDD || "admin",
"database": process.env.DATABASE_BBDD || "mydatabase",
"synchronize": false,