Skip to content

Instantly share code, notes, and snippets.

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

Zakarya Mamouni zakthedev

🏠
Working from home
  • Mostaganem
View GitHub Profile
@copy-ninja1
copy-ninja1 / base.type.ts
Last active March 22, 2025 16:25
Prisma Base Service with nestjs
export type Operations =
| 'aggregate'
| 'count'
| 'create'
| 'createMany'
| 'delete'
| 'deleteMany'
| 'findFirst'
| 'findMany'
| 'findUnique'

Postgresql & PgAdmin

version: '3.5'

services:
  postgres:
    container_name: postgres_container
    image: postgres
    environment:
 POSTGRES_USER: ${POSTGRES_USER:-postgres}
version: '3.5'
# docker with pgadmin/postgres/nodejs
# endable docker to start with OS
# - sudo systemctl enable docker
# to run:
# sudo docker-compose up -d
# remove the -d to get messages from docker, do not run in vscode
# todo add redis memory db for users etc
services:
postgres:
@taion
taion / server.js
Last active March 11, 2024 10:20
GraphQL subscription server with Socket.IO, backed by Redis Pub/Sub
const redisClient = redis.createClient(REDIS_URL);
const listeners = Object.create(null);
function addListener(channel, listener) {
if (!listeners[channel]) {
listeners[channel] = [];
redisClient.subscribe(channel);
}
listeners[channel].push(listener);
@santoshachari
santoshachari / Virtual Blocks on Nginx.md
Last active October 3, 2024 21:26
Setup additional sites on Nginx

Inspired and edited from this Digital Ocean tutorial.

Follow the steps on this gist to setup a LEMP stack with PHP 7.0.

The steps assume Nginx has been configured correctly.

Setup the root directories

For the domains example.com and test.com, create the folders.