Skip to content

Instantly share code, notes, and snippets.

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

Faozul Azim cometofsky

🏠
Working from home
View GitHub Profile
@cometofsky
cometofsky / Useful_Websites.md
Created January 10, 2025 15:18
Useful Websites for Developers
@cometofsky
cometofsky / mongodb-shell-commands.txt
Created December 23, 2024 16:03
Commands inside mongodb shell
Episode 99::
db.COLLECTION.find() //find returns a cursor
db.COLLECTION.find().count()
db.COLLECTION.next() //gives next one document
const dataCursor = db.COLLECTION.find() //store cursor in a variable
dataCursor.next() //gives next one document
datacursor.forEach(doc => {printjson(doc)}) //prints all documents one by one (printjson is provided by mongo shell)
//after the above forEach the dataCursor.next() will give error, because the cursor is empty
dataCursor.hasNext() //gives if there is any next document available
@cometofsky
cometofsky / nginx.conf
Last active December 9, 2024 16:07
simple nginx configuration file for load balancing requests to multiple servers
# Main context (this is the global configuration)
worker_processes 1;
events {
worker_connections 1024;
}
http {
include mime.types;
<?php
declare(strict_types=1);
namespace Rafi\Commission;
use Rafi\CurrencyExchangeRate\FetchContent;
class AmountCurrencyAware
{