This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| namespace App\Session; | |
| use Illuminate\Session\DatabaseSessionHandler; | |
| class MongoSessionHandler extends DatabaseSessionHandler | |
| { | |
| /** |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| QUEUE_DB_HOST= | |
| QUEUE_DB_PORT=27017 | |
| QUEUE_DB_USER=root | |
| QUEUE_DB_PASS=12345678 | |
| QUEUE_DB_NAME=test | |
| QUEUE_DB_COLL=queue |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "private": true, | |
| "scripts": { | |
| "dev": "vite", | |
| "build": "vite build" | |
| }, | |
| "devDependencies": { | |
| "@tailwindcss/forms": "^0.5.2", | |
| "@tailwindcss/typography": "^0.5.0", | |
| "alpinejs": "^3.0.6", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| // Lemmod - Couldn't be bothered to make my own class as this works as well | |
| /** | |
| * STable - Generate HTML Tables | |
| * | |
| * @package STable | |
| * @category STable | |
| * @name STable | |
| * @version 1.0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from collections import defaultdict | |
| from threading import Lock | |
| class EventBus: | |
| def __init__(self): | |
| self.events = defaultdict(list) | |
| self.lock = Lock() | |
| def subscribe(self, event, callback): | |
| with self.lock: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const EventEmitter = require('events'); | |
| const eventBus = new EventEmitter(); | |
| module.exports = eventBus; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const WebSocket = require('ws'); | |
| const winston = require('winston'); | |
| const logger = winston.createLogger({ | |
| level: 'info', | |
| format: winston.format.json(), | |
| transports: [ | |
| new winston.transports.Console() | |
| ] | |
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //https://gist.github.com/puuble/d501bcdc03fb43499e09553458827c42 part 2 | |
| const MongoClient = require('mongodb').MongoClient; | |
| const AWS = require('aws-sdk'); | |
| const sqs = new AWS.SQS({ | |
| region: 'us-west-2', | |
| accessKeyId: 'ACCESS_KEY', | |
| secretAccessKey: 'SECRET_KEY' | |
| }); | |
| const queueUrl = 'https://sqs.us-west-2.amazonaws.com/1234567890/my-queue'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const { Worker, isMainThread, parentPort } = require('worker_threads'); | |
| const WebSocket = require('ws'); | |
| const AWS = require('aws-sdk'); | |
| const sqs = new AWS.SQS({ | |
| region: 'us-west-2', | |
| accessKeyId: 'ACCESS_KEY', | |
| secretAccessKey: 'SECRET_KEY' | |
| }); | |
| const queueUrl = 'https://sqs.us-west-2.amazonaws.com/1234567890/my-queue'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import threading | |
| from queue import Queue | |
| import boto3 | |
| from pymongo import MongoClient | |
| class LogService: | |
| def __init__(self): | |
| self.client = MongoClient('mongodb://localhost:27017/') | |
| self.db = self.client['logs'] |
OlderNewer