Skip to content

Instantly share code, notes, and snippets.

View mo-sharif's full-sized avatar
🐾
Sir codes a lot

Mo Sharif mo-sharif

🐾
Sir codes a lot
View GitHub Profile
name: Publish package to NPM
on:
workflow_dispatch:
inputs:
release-type:
description: 'Release type (one of): patch, minor, major, prepatch, preminor, premajor, prerelease'
required: true
jobs:
release:
runs-on: ubuntu-latest
@mo-sharif
mo-sharif / graphql_vs_rest.txt
Last active July 31, 2024 16:28
Comparison: GraphQL vs. RESTful API
| Feature/Aspect | GraphQL | RESTful API |
|--------------------|------------------------------------------|--------------------------------------------|
| Data Fetching | Client specifies exactly what it needs | Fixed responses from predefined endpoints |
| Schema | Strongly typed schema | No enforced schema |
| Endpoints | Single endpoint | Multiple endpoints |
| Real-Time Support | Built-in subscriptions | Requires additional protocols like WebSockets |
| Caching | More complex, requires custom solutions | Native HTTP caching (ETags, Cache-Control) |
| Documentation | Self-documenting via introspection | Separate documentation needed |
| Flexibility | High, client-driven queries | Lower, server-driven responses |
| Setup Complexity |
@mo-sharif
mo-sharif / gist:53a0bd96c5af9071ac5c934355fcc481
Created July 9, 2024 17:21
Front-end Engineering Manager Interview prep questions with sample answers
Technical Questions
What is your experience with cloud technologies (e.g., AWS, Azure, Google Cloud)? How have you used these in past projects?
Answer:
"I have extensive experience with AWS, where I have utilized services like EC2, S3, Lambda, and RDS. For example, in my previous role at [Company], I led a project to migrate our on-premise infrastructure to AWS, which resulted in a 30% cost reduction and improved scalability. We used CloudFormation for infrastructure as code, which streamlined our deployment process and ensured consistency across environments."
Can you discuss your experience with microservices architecture? What are the benefits and challenges you've encountered?
Answer:
"I have implemented microservices architecture in multiple projects. The benefits include improved scalability, better fault isolation, and more flexible deployments. However, the challenges involve managing inter-service communication, data consistency, and increased complexity in deployment. At [Company], we used Kuberne
Next.js is a popular React framework that provides powerful features for building modern web applications. Here are some of the top features and benefits of using Next.js:
1. Server-Side Rendering (SSR)
Description: Next.js allows you to render pages on the server at runtime, providing better performance and SEO benefits compared to client-side rendering.
Benefit: Faster initial page loads and improved search engine indexing.
2. Static Site Generation (SSG)
Description: Next.js can generate static HTML pages at build time, which can be served with virtually no latency.
Benefit: Extremely fast page loads and the ability to serve content from a CDN.
@mo-sharif
mo-sharif / useCollections.ts
Last active July 31, 2024 16:27
Firebase Firestore collection query hook in Gatsby
/**
* Custom Hook to get list of all Collections
* @param {Object} firebase.collection - Collection function in firebase provides access to collection in db
* @param {Object} collectionPath - Contains details about what to query, one of the items is collectionPath: Path to collection or doc in firebase ex: COLLECTION_NAME/DOC_ID
* @param {String} locationHash - History location hash value of current url e.g. "#HASH_VALUE"
*
* @example
* // pass collection path e.g. collectionName/docName/collectionName
* // initial data if needed
* // Firebase class instant
@mo-sharif
mo-sharif / gist:b1937bab4577f6119437dc061f3555f6
Created August 20, 2020 16:53
Netlify build configs for Gatsby
# Global build commands
[build]
command = "gatsby build"
publish = "public/"
# Installed Netlify plugins
[[plugins]]
package = "netlify-plugin-gatsby-cache"
[[plugins]]
@mo-sharif
mo-sharif / circleci-react-firebase
Last active August 20, 2020 16:55
CircleCI workflow for React with firebase
# Javascript Node CircleCI 2.0 configuration file
# Check https://circleci.com/docs/2.0/ for more details
version: 2
jobs:
build:
docker:
- image: circleci/node:dubnium
steps:
@mo-sharif
mo-sharif / react_samples_list.md
Created December 8, 2018 06:02 — forked from jpalala/react_samples_list.md
React Samples List
@mo-sharif
mo-sharif / gist:48da5950d6907a80c82c7fbaca5c5f12
Created October 18, 2018 16:29 — forked from paulallies/gist:0052fab554b14bbfa3ef
Remove node_modules from git repo
#add 'node_modules' to .gitignore file
git rm -r --cached node_modules
git commit -m 'Remove the now ignored directory node_modules'
git push origin master