Skip to content

Instantly share code, notes, and snippets.

View pookdeveloper's full-sized avatar
🦊
developing

pookdeveloper pookdeveloper

🦊
developing
  • pookdeveloper
  • Spain
  • 16:55 (UTC +01:00)
View GitHub Profile
@pookdeveloper
pookdeveloper / ormconfig.js
Last active March 30, 2022 13:11
typeORM 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,
@pookdeveloper
pookdeveloper / ormconfig.json
Last active April 18, 2020 16:21
typeORM ormconfig.json
{
"type": "mysql",
"host": "localhost",
"port": 3306,
"username": "root",
"password": "admin",
"database": "mydatabase",
"synchronize": false,
"logging": true,
"entities": [
@pookdeveloper
pookdeveloper / custom.ts
Last active April 18, 2020 16:24
Example dinamic querys like loopback with typeorm
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 / example-model.js
Created June 12, 2019 07:01
Loopback 3 overrride default method of controller
'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 () {

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:

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:

@pookdeveloper
pookdeveloper / custom_formatter_snippet.js
Created September 27, 2023 16:16
custom formatter snippet
window.devtoolsFormatters = [{
header: function(obj) {
if(!obj.__format){
return null
}
delete obj.__format;
return ['div', {}, `${JSON.stringify(obj, null, 2)}`]
},
hasBody: function(){
return false;
@pookdeveloper
pookdeveloper / strava-auto-kudos.js
Created October 2, 2023 07:55
strava auto kudos
// ==UserScript==
// @name Strava Auto Kudos
// @namespace http://tampermonkey.net/
// @version 0.1
// @description Automatically like Strava posts.
// @author You
// @match https://www.strava.com/dashboard
// @icon https://www.google.com/s2/favicons?sz=64&domain=strava.com
// @grant none
// ==/UserScript==
@pookdeveloper
pookdeveloper / sh
Created November 10, 2023 14:38
git nah
# Git alias ⬇️
[alias]
nah = "!f(){ git reset --hard; git clean -df; if [ -d ".git/rebase-apply" ] || [ -d ".git/rebase-merge" ]; then git rebase --abort; fi; }; f"
# Bash function ⬇️
nah () {
git reset --hard
git clean -df
if [ -d ".git/rebase-apply" ] || [ -d ".git/rebase-merge" ]; then
git rebase --abort