Skip to content

Instantly share code, notes, and snippets.

View daniromome's full-sized avatar
🏠
Working from home

Daniel Sánchez daniromome

🏠
Working from home
View GitHub Profile
export interface ApiSuccessResponse<T> {
success: true
data: T
}
export interface ExceptionData {
error: string
message: string
}
import { AUTH_ACTION, AuthAction, AuthToken, IdentityProvider } from '@models/auth'
import { createAdapter } from '@state-adapt/core'
import { ApiException } from '@exceptions/api.exception'
interface AuthState {
idp?: IdentityProvider
token?: AuthToken
loading: Record<AuthAction, boolean>
exception?: ApiException
}
import { Injectable, effect, inject } from '@angular/core'
import { HttpClient } from '@angular/common/http'
import { AUTH_PROVIDER, AuthProvider, AuthToken, IdentityProvider, ProviderProfile } from '@models/auth'
import { Observable, catchError, concatMap, from, map, mergeMap, of, timer } from 'rxjs'
import { environment } from '@environment'
import { adapt } from '@state-adapt/angular'
import { authAdapter, initialAuthState } from './auth.adapter'
import { Source, toSource } from '@state-adapt/rxjs'
import { ApiException } from '@exceptions/api.exception'
import { toSignal } from '@angular/core/rxjs-interop'
[12:13:02] [luckperms-worker-6/INFO]: Postgres listen/notify connection re-established
[12:13:07] [luckperms-worker-6/WARN]: Postgres listen/notify connection dropped, trying to re-open the connection
[12:13:07] [luckperms-worker-6/INFO]: [STDERR]: java.sql.SQLException: Cannot unwrap to me.lucko.luckperms.lib.postgresql.PGConnection
[12:13:07] [luckperms-worker-6/INFO]: [STDERR]: at org.postgresql.jdbc.PgConnection.unwrap(PgConnection.java:1641)
[12:13:07] [luckperms-worker-6/INFO]: [STDERR]: at me.lucko.luckperms.lib.hikari.pool.ProxyConnection.unwrap(ProxyConnection.java:481)
[12:13:07] [luckperms-worker-6/INFO]: [STDERR]: at me.lucko.luckperms.common.messaging.postgres.PostgresMessenger$NotificationListener.listenAndBind(PostgresMessenger.java:140)
[12:13:07] [luckperms-worker-6/INFO]: [STDERR]: at me.lucko.luckperms.common.messaging.postgres.PostgresMessenger.lambda$checkAndReopenConnection$1(PostgresMessenger.java:117)
[12:13:07] [luckperms-worker-6/INFO]: [STDERR]:
@daniromome
daniromome / keypair-generator.ts
Created October 29, 2021 03:59
Practicing node child process API and async iterators
/**
* @author Dani Romo <dani9oo.dev@gmail.com>
*/
import { spawn } from 'child_process'
import { mkdir, readFile, rmdir, writeFile } from 'fs/promises'
import { join, resolve } from 'path'
export class KeypairGenerator {
private name: string