Skip to content

Instantly share code, notes, and snippets.

View rehan-sattar's full-sized avatar
🌠
Stars is all about!

Rehan Sattar rehan-sattar

🌠
Stars is all about!
View GitHub Profile
@rehan-sattar
rehan-sattar / data.ts
Created May 28, 2023 18:45 — forked from prateekkathal/data.ts
Seeding Databases Using NestJS
export const languages: ILanguage[] = [
{ name: 'English' },
{ name: 'French' },
{ name: 'Spanish' },
{ name: 'Russian' },
// ... and others ...
];
@rehan-sattar
rehan-sattar / nginx.conf
Created September 27, 2022 17:32 — forked from plentz/nginx.conf
Best nginx configuration for improved security(and performance)
# to generate your dhparam.pem file, run in the terminal
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048
@rehan-sattar
rehan-sattar / app.js
Last active August 17, 2019 08:20
Image uploading, profile picture.
const updateProfile = async (req, res) => {
const userId = req.params.id;
if (req.files && Object.keys(req.files).length === 0) {
return res.status(400).send('No files were uploaded');
}
// check if user has uploaded profile picture.
let profilePicture = req.files ? req.files.profilePicture : {};
const user = await User.findById(userId);