Skip to content

Instantly share code, notes, and snippets.

View ibnsamy96's full-sized avatar
😶
trying to find hope

Mahmoud Samy ibnsamy96

😶
trying to find hope
View GitHub Profile
http://git-scm.com/book/en/Git-Branching-Basic-Branching-and-Merging
// adding branch2 commets to branch1
$ git checkout <branch1>
$ git merge <branch2>
// merging a branch to main
$ git checkout main
$ git merge <branch needed to be merged to main>
As described in this file, all windows store apps are blocked from accessing localhost, you need to enable that by cmd.
https://github.com/jenius-apps/nightingale-rest-api-client/blob/master/docs/localhost.md
To give Nightingale the permission to access your localhost you need to open cmd in administrator mode and enter that command:
checknetisolation loopbackexempt -a -p=S-1-15-2-2472482401-1297737560-3464812208-2778208509-1273584065-1826830168-474783446

I faced a problem that I couldn't use vercel environment variables with a deployed angular app. I used to write my sensitive information in an env file while writing backend code and I forgot that browsers don't support the process module. So I searched for a while and got the result I want by following these steps:

  1. install the next package:
    npm install --save-dev @angular-builders/custom-webpack
    
  2. open angular.json and use "builder": "@angular-builders/custom-webpack:browser" instead of "builder": "@angular-devkit/build-angular:browser"
  3. add customWebpackConfig key in options object with a path to a file that you will create later:
     "options": { "customWebpackConfig": {"path": "custom-webpack-config.js"} }
@ibnsamy96
ibnsamy96 / Using the unfamiliar css units
Created January 15, 2022 13:40
A summary talking about some css units and their best use cases
rem:
- relative to the font size of the root elemnt (initially 1rem = 16px)
- better for font-size as it works well with browser font-size preferences (user may change his default font-size value)
- working with rem can be by setting font-size value in the HTML element to be 62.5% ( now 16px = 1.6rem & 37px = 3.7rem ...)
- can be used with margin/padding if you don't want them to change with the font-size space of the element
- if you set *{margin-top:1rem} then all elements has the same top spaceing
em:
- relative to the font-size of its direct or nearest parent
- better to be used with media-query values as px & rem have some compatibility issues for some browsers