Skip to content

Instantly share code, notes, and snippets.

View sonidelav's full-sized avatar
🐈

Valentinos Galanos sonidelav

🐈
View GitHub Profile
@sonidelav
sonidelav / PromisableBootstrapModal.vue
Last active March 17, 2021 15:36
I Promise a Modal
<template>
<div class="modal fade" tabindex="-1" role="dialog" aria-hidden="true">
<div class="modal-dialog modal-dialog-centered" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title">{{ title }}</h5>
</div>
<div class="modal-body">
<p>{{ message }}</p>
</div>
<div id="dynamicexample">
<h3>Scroll down inside this section ↓</h3>
<p v-pin:[direction]="200">I am pinned onto the page at 200px to the left.</p>
</div>
Vue.directive('pin', {
bind: function (el, binding, vnode) {
el.style.position = 'fixed'
var s = (binding.arg == 'left' ? 'left' : 'top')
el.style[s] = binding.value + 'px'
}
@sonidelav
sonidelav / api_index.ts
Created December 6, 2020 10:19
NestJS as Nuxt's serverMiddleware (Nuxt Typescript)
import express from 'express';
import { NestFactory } from "@nestjs/core";
import { ExpressAdapter } from "@nestjs/platform-express";
import { ApiModule } from "./nest/ApiModule";
import { INestApplication, Injectable, NestMiddleware } from "@nestjs/common";
@Injectable()
export class AppMiddleware implements NestMiddleware {
private nestInstance: INestApplication | undefined;